::std::conv::

Function uint_to_bits

pub fn uint_to_bits<#uint N>(input: uint<N>) -> [bool; N]
Expand

Casts an unsigned integer to an array of bool by reinterpreting its bits.

Bits are laid out from LSB to MSB, so the first element of the array corresponds to the LSB of the input number and the last element corresponds to its MSB.

Note that bits in the literal binary representation of the number are written right-to-left, while items in the literal representation of the array are written left-to-right.

Examples

assert uint_to_bits(0u0) == [];
assert uint_to_bits(0b1101u4) == [true, false, true, true];