Expand description
Various traits for performing logic or bitwise operations on numbers.
Traits§
- BitAccess
- Defines functions that access or modify individual bits in a number.
- BitBlock
Access - Defines functions that access or modify blocks of adjacent bits in a number.
- BitConvertible
- Defines functions that express a number as a
Vec
of bits or construct a number from an iterator of bits. - BitIterable
- Defines an iterator over a value’s bits.
- BitScan
- Defines functions that search for the next
true
orfalse
bit in a number, starting at a specified index and searching in the more-significant direction. - Checked
Hamming Distance - Returns the Hamming distance between two numbers, or the number of bit flips needed to turn one into the other.
- Count
Ones - Returns the number of ones in the binary representation of a number.
- Count
Zeros - Returns the number of zeros in the binary representation of a number.
- Hamming
Distance - Returns the Hamming distance between two numbers, or the number of bit flips needed to turn one into the other.
- Leading
Zeros - Returns the number of leading zeros in the binary representation of a number.
- LowMask
- Returns a number whose least significant $b$ bits are
true
and whose other bits arefalse
. - NotAssign
- Replaces a number with its bitwise negation.
- Significant
Bits - Trailing
Zeros - Returns the number of trailing zeros in the binary representation of a number.