Function morton_encoding::arbitrary_bit_size::bloat_custom_biguint[][src]

pub fn bloat_custom_biguint<Coor>(x: Coor, siz_rat: NonZeroUsize) -> BigUint where
    Coor: ToPrimitive,
    BigUint: From<Coor>, 

“Bloats” a given number to an arbitrarily large BigUint.

Each bit of the input is interleaved with siz_rat - 1 zeroes.

This function assumes that the user will not need to use numbers larger than usize::max_value() bytes in size.

Unavailable if compiled with no_std.

Examples

assert_eq!(bloat_custom_biguint(1u32, nz(2)), tobuint(1u8));
assert_eq!(bloat_custom_biguint(u128::max_value(), nz(32)), BigUint::new(vec!(1u32; 128)));