4个版本

0.1.3 2019年11月8日
0.1.2 2019年11月7日
0.1.1 2019年11月7日
0.1.0 2019年11月7日

718数学 类别中

Download history 2/week @ 2023-11-10 2/week @ 2023-11-17 8/week @ 2023-11-24 14/week @ 2023-12-01 4/week @ 2023-12-15 8/week @ 2023-12-22 2/week @ 2024-01-12 8/week @ 2024-01-19 4/week @ 2024-01-26 4/week @ 2024-02-02 7/week @ 2024-02-09 54/week @ 2024-02-16 119/week @ 2024-02-23

每月下载 184次

MIT 许可证

7KB
106

Mathlogic

extern crate mathlogic;
extern crate mathlogic::math;
extern crate mathlogic::weight;
extern crate mathlogic::calculater_int;
extern crate mathlogic::calculater_float;

数学函数

幂函数

let power = mathlogic::math::pow(2, 8);
println!("{}", power); 

平方函数

let square = mathlogic::math::square(25.4);
println!("Square is {}", square);

百分比函数

let percentage = mathlogic::math::percentage(154.5, 200.0);
println!("Percentage is {}%", percentage);

斐波那契数列函数

let a = mathlogic::math::fibonacci(10, 50, 10);
println!("Result => {:?}", a); //This will return result in Vector

圆半径函数

let cr = mathlogic::math::circle_radius(20.8);
println!("Radius of Circle is {}", cr);

整数值运算计算器

let add = mathlogic::calculate_int::add(10, 20);
let min = mathlogic::calculate_int::min(50, 20);
let div = mathlogic::calculate_int::div(20, 80);
let mul = mathlogic::calculate_int::mul(10, 50);

println!("Result of add is {}", add);
println!("Result of min is {}", min);
println!("Result of div is {}", div);
println!("Result of mul is {}", mul);

浮点值运算计算器

let add = mathlogic::calculate_float::add(10.4, 20.55);
let min = mathlogic::calculate_float::min(50.5, 20.3);
let div = mathlogic::calculate_float::div(20.2, 80.4);
let mul = mathlogic::calculate_float::mul(10.5, 50.6);

println!("Result of add is {}", add);
println!("Result of min is {}", min);
println!("Result of div is {}", div);
println!("Result of mul is {}", mul);

重量函数

磅到千克和克

let ltk = mathlogic::weight::lbs_to_kgs(50.5);
println!("Pounds to Kilograms {}", ltk);

let ltg = mathlogic::weight::lbs_to_grms(50.5);
println!("Pounds to Grams {}", ltg);

千克到磅和克

let ktl = mathlogic::weight::kgs_to_lbs(22.906649732377755);
println!("Kilograms to Pounds {}", ktl);

let ktg = mathlogic::weight::kgs_to_grms(150.550);
println!("Kilograms to Grams {}", ktg);

克到磅和千克

let gtl = mathlogic::weight::grms_to_lbs(22.90);
println!("Grams to Pounds {}", gtl);

let gtk = mathlogic::weight::grms_to_kgs(500.255);
println!("Grams to Kilograms {}", gtk);

无运行时依赖