maths_function

Crates.iomaths_function
lib.rsmaths_function
version0.1.4
sourcesrc
created_at2023-12-12 09:46:21.03166
updated_at2023-12-17 10:26:40.337734
descriptionSome maths fuctions
homepagehttps://github.com/Suns627/My-rust-lib/blob/main/documentation.txt
repositoryhttps://github.com/Suns627/My-rust-lib
max_upload_size
id1066209
size2,860
(Suns627)

documentation

https://github.com/Suns627/My-rust-lib/blob/main/documentation.txt

README

There are some easy math fuction,there are add...... You can use the add function too add,and use subtract...... There is code: pub mod math_functions { pub fn add(a: i32, b: i32) -> i32 { a + b } pub fn subtract(a: i32, b: i32) -> i32 { a - b } pub fn multiply(a: i32, b: i32) -> i32 { a * b } pub fn divide(a: i32, b: i32) -> Result<i32, &'static str> { if b == 0 { Err("Cannot divide by zero") } else { Ok(a / b) } } }

And use distance: fn main(){ let ax: i32 = ......; let ...... ...... println!("{}",distance(ax,ay,bx,by)); }

Commit count: 14

cargo fmt