pub type Fraction = GenericFraction<u64>;
Expand description
Fraction consisting from two u64
numbers
Allows to keep and work with fractions on stack.
Be aware of possible stack overflows that might be caused by
exceeding u64
limits in some math operations, which will make thread to panic.
§Examples
use fraction::Fraction;
let first = Fraction::new (1u8, 2u8);
let second = Fraction::new (2u8, 8u8);
assert_eq! (first + second, Fraction::new (3u8, 4u8));
Aliased Type§
enum Fraction {
Rational(Sign, Ratio<u64>),
Infinity(Sign),
NaN,
}