Expand description
Traits for logic and bit manipulation.
Modules§
- bit_
access BitAccess
, a trait for getting and setting individual bits of a number.- bit_
block_ access BitBlockAccess
, a trait for getting and setting adjacent blocks of bits in a number.- bit_
convertible BitConvertible
, a trait for extracting all bits from a number or constructing a number from bits.- bit_
iterable BitIterable
, a trait for producing a double-ended iterator over a number’s bits.- bit_
scan BitScan
, a trait for finding the nexttrue
orfalse
bit in a number after a provided index.- count_
ones CountOnes
, a trait for counting the number of ones in the binary representation of a number.- count_
zeros CountZeros
, a trait for counting the number of ones in the binary representation of a number.- hamming_
distance HammingDistance
andCheckedHammingDistance
, traits for computing the Hamming distance between two numbers.- leading_
zeros LeadingZeros
, a trait for determining the number of zeros that a number starts with, when written in binary using $W$ bits, $W$ being the type width.- low_
mask LowMask
, a trait for generating a low bit mask (a number in which only the $k$ least-significant bits are 1).- not
NotAssign
, a trait for replacing a number with its bitwise negation.- significant_
bits SignificantBits
, a trait for determining how many significant bits a number has.- trailing_
zeros TrailingZeros
, a trait for determining the number of zeros that a number ends with when written in binary.- traits
- Various traits for performing logic or bitwise operations on numbers.