The bits module provides several portable low-level functions for bits manipulation:
seq::popcnt64
: population count on a 64 bits wordseq::popcnt32
: population count on a 32 bits wordseq::popcnt16
: population count on a 16 bits wordseq::popcnt8
: population count on a 8 bits wordseq::bit_scan_forward_32
: index of the lowest set bit in a 32 bits wordseq::bit_scan_forward_64
: index of the lowest set bit in a 64 bits wordseq::bit_scan_reverse_32
: index of the highest set bit in a 32 bits wordseq::bit_scan_reverse_64
: index of the highest set bit in a 32 bits wordseq::bit_scan_forward
: index of the lowest set bit in a size_t wordseq::bit_scan_reverse
: index of the highest set bit in a size_t wordseq::static_bit_scan_reverse
: index of the highest set bit at compile timeseq::count_digits_base_10
: number of digits to represent an integer in base 10seq::nth_bit_set
: index of the nth set bit in a 64 bits wordseq::byte_swap_16
: byte swap for 16 bits wordseq::byte_swap_32
: byte swap for 32 bits wordseq::byte_swap_64
: byte swap for 64 bits word