Module bitwise

Module bitwise 

Source
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§

BinaryFormatFunction
BINARY_FORMAT(n, separator, group_size) - Format binary with separator
BitNotFunction
BITNOT(a) - Bitwise NOT operation
CountBitsFunction
COUNT_BITS(n) - Count number of set bits (popcount)
HighestBitFunction
HIGHEST_BIT(n) - Returns the position of the highest set bit
IsPowerOfTwoFunction
IS_POWER_OF_TWO(n) - Check if number is exact power of two
LowestBitFunction
LOWEST_BIT(n) - Returns the position of the lowest set bit
NextPowerOfTwoFunction
NEXT_POWER_OF_TWO(n) - Returns the next power of two greater than or equal to n

Functions§

register_bitwise_functions
Register all bitwise functions