Type Alias fraction::prelude::BigFraction
source · pub type BigFraction = GenericFraction<BigUint>;
Expand description
Fraction consisting from two BigUint
numbers
Allows to keep and work with fractions on heap.
BigUint number is based on heap and does not have any limits, which makes BigFraction safe from stack overflows. However, it comes with a price of making allocations on every math operation.
§Examples
use fraction::BigFraction;
let first = BigFraction::new (2u8, 3u8);
let second = BigFraction::new (1u8, 6u8);
assert_eq! (first + second, BigFraction::new (5u8, 6u8));
Aliased Type§
enum BigFraction {
Rational(Sign, Ratio<BigUint>),
Infinity(Sign),
NaN,
}