Expand description
Bitwise operations and binary visualization functions
This module provides additional bitwise functions not covered by the bigint module. Basic operations like BITAND, BITOR, BITXOR, TO_BINARY, FROM_BINARY are in bigint.
Structs§
- Binary
Format Function - BINARY_FORMAT(n, separator, group_size) - Format binary with separator
- BitNot
Function - BITNOT(a) - Bitwise NOT operation
- Count
Bits Function - COUNT_BITS(n) - Count number of set bits (popcount)
- Highest
BitFunction - HIGHEST_BIT(n) - Returns the position of the highest set bit
- IsPower
OfTwo Function - IS_POWER_OF_TWO(n) - Check if number is exact power of two
- Leading
Zeros Function - LEADING_ZEROS(n [, width]) - Number of leading zero bits in the binary
representation of
n, viewed as an unsigned integer of the given width. - Lowest
BitFunction - LOWEST_BIT(n) - Returns the position of the lowest set bit
- Next
Power OfTwo Function - NEXT_POWER_OF_TWO(n) - Returns the next power of two greater than or equal to n
- Popcount
Function - POPCOUNT(n) - Population count: number of set bits in an integer.
- Trailing
Zeros Function - TRAILING_ZEROS(n) - Number of trailing zero bits in
n.
Functions§
- register_
bitwise_ functions - Register all bitwise functions