Mathlogic

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

Math Functions

Power function

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

Square function

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

Percentage function

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

Fibonacci series function

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

Radius of Circle function

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

Calculator for integer value operations

``` let add = mathlogic::calculateint::add(10, 20); let min = mathlogic::calculateint::min(50, 20); let div = mathlogic::calculateint::div(20, 80); let mul = mathlogic::calculateint::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); ```

Calculator for float value operations

``` let add = mathlogic::calculatefloat::add(10.4, 20.55); let min = mathlogic::calculatefloat::min(50.5, 20.3); let div = mathlogic::calculatefloat::div(20.2, 80.4); let mul = mathlogic::calculatefloat::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); ```

Weight Functions

Lbs to Kgs and Grams

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

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

Kgs to Lbs and Grams

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

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

Grams to Lbs and Kgs

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

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