A minimal library for representing rational numbers (ratios of integers).

Example

```rust // all rationals are automatically reduced when created, so equality works as following: let onehalf = Rational::new(1, 2); let twoquarters = Rational::new(2, 4); asserteq!(onehalf, two_quarters);

// you can make more complicated rationals: let onehalfoveronequarter = Rational::new(Rational::new(1, 2), Rational::new(1, 4)); // (1/2)/(1/4) asserteq!(onehalfoverone_quarter, Rational::new(2, 1));

// mathematical operations are implemented for integers and rationals: let oneninth = Rational::new(1, 9); asserteq!(oneninth + Rational::new(5, 4), Rational::new(49, 36)); asserteq!(oneninth - 4, Rational::new(-35, 9)); asserteq!(one_ninth / Rational::new(21, 6), Rational::new(2, 63));

// other properties, such as // inverse let r = Rational::new(8, 3); let inverse = r.inverse(); asserteq!(inverse, Rational::new(3, 8)); asserteq!(inverse, Rational::new(1, r)); // mixed fraction let (whole, fractional) = r.mixedfraction(); asserteq!(whole, 2); assert_eq!(fractional, Rational::new(2, 3)); ```