Expand description
Re-export 128 bit helpers. Some helper functions to work with 128bit numbers. Note that the functionality provided here is only sensible to use with 128bit numbers because for smaller sizes, you can always rely on assumptions of a bigger type (u128) being available, or simply create a per-thing and use the multiplication implementation provided there.
Functionsยง
- gcd
- Helper gcd function used in Rational128 implementation.
- multiply_
by_ rational_ with_ rounding - Returns
a * b / c
(wrapping to 128 bits) orNone
in the case of overflow. - split
- split a u128 into two u64 limbs
- sqrt
- to_
big_ uint - Convert a u128 to a u32 based biguint.