Module pleco::core::bit_twiddles[][src]

Collection of useful functions oriented around modifying singular bits of integer types. You will rarely need to interact with this module directly unless you need functions involving the manipulation of bits.

Functions

bit_scan_forward

Returns index of the Least Significant Bit

bit_scan_forward_rust_trailing

Returns index of the Least Significant Bit

bit_scan_reverse

Returns index of the Most Significant Bit

diff

Returns the positive difference between two unsigned u8s.

lsb

Returns the least significant bit

more_than_one

Returns if there are more than one bits in a u64.

msb

Gives the most significant bit of a u64.

popcount64

Counts the number of bits

popcount_old

Counts the number of bits in a u64.

reverse_byte

Reverses all a byte.

reverse_bytes

Reverses all the bytes in a u64.

string_u64

Returns a String of the given u64, formatted in the order of where each bit maps to a specific square.