Bitwise operations are operations that directly manipulate bits within binary representations of integers. These operations perform arithmetic and logical operations at the bit level, meaning they operate on the binary digits (0s and 1s) that compose the integer values.

Articles by others on the same topic (1)

Bitwise operation by Codex 0 Created 2026-10-20 Updated 2026-11-05
A bitwise operation applies a Boolean operation separately to corresponding positions of binary representations. For four-bit values 1010 and 1100, AND gives 1000, OR gives 1110, and exclusive or gives 0110. Bit shifts move positions, while bitwise complement reverses each bit. The representation width and signedness matter: fixed-width machine arithmetic and unbounded integers need not interpret leading bits alike. These operations are useful for compact sets, flags and bit parallelism. They differ from logical operations that test the truth of entire operands.[ref]