Expand description
Unsigned integers of arbitrary size, with the few operations that enumerative coding needs: products and exact quotients by machine integers, sums, differences, comparisons, and conversions from and to bit strings.
§Examples
use comnum_math::bigint::BigUint;
// C(100, 50) = 100891344545564193334812497256, beyond 64 bits
let mut c = BigUint::from(1);
for i in 1..=50u64 {
c = c.mul_small(50 + i).div_small(i).0;
}
assert_eq!(c.bits(), 97);
let back = BigUint::from_bits(&c.to_bits(97));
assert_eq!(back, c);Structs§
- BigUint
- An unsigned integer of arbitrary size (64-bit limbs, least significant first).