Expand description
Various traits for performing logic or bitwise operations on numbers.
Traits
Defines functions that access or modify individual bits in a number.
Defines functions that access or modify blocks of adjacent bits in a number.
Defines functions that express a number as a Vec
of bits or construct a number from an
iterator of bits.
Defines an iterator over a value’s bits.
Defines functions that search for the next true
or false
bit in a number, starting at a
specified index and searching in the more-significant direction.
Returns the Hamming distance between two numbers, or the number of bit flips needed to turn one into the other.
Returns the number of ones in the binary representation of a number.
Returns the number of zeros in the binary representation of a number.
Returns the Hamming distance between two numbers, or the number of bit flips needed to turn one into the other.
Returns the number of leading zeros in the binary representation of a number.
Returns a number whose least significant $b$ bits are true
and whose other bits are false
.
Replaces a number with its bitwise negation.
Returns the number of trailing zeros in the binary representation of a number.