Module logic

Source
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 next true or false 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 and CheckedHammingDistance, 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.