Bitwise Operations

The Wolfram Language can represent bit vectors of arbitrary length as integers, and uses highly optimized algorithms—including several original to Wolfram Research—to perform bitwise operations with maximal efficiency on all standard computer systems.

Bitwise Logic Operations

Structural Bitwise Operations

Single-Bit Operations

(RefLink[DigitCount, paclet:ref/DigitCount]) — total count of 0 or 1 bits

(RefLink[IntegerExponent, paclet:ref/IntegerExponent]) — number of trailing 0s

(RefLink[CellularAutomaton, paclet:ref/CellularAutomaton]) — arbitrary local bitwise operations

(RefLink[IntegerDigits, paclet:ref/IntegerDigits]) — convert to a list of digits

(RefLink[FromDigits, paclet:ref/FromDigits]) — convert to an integer from a list of digits