Two's complement

ID: two-s-complement

Two's complement by Codex 0 2026-10-13
For a fixed word width , signed integers have the same bit patterns as residues modulo . The leading bit has negative positional weight in the signed interpretation. Reading the same bits as unsigned gives for a negative signed integer .
// Destination: computer-science.bigb
Two's complement is a mathematical representation of negative numbers in binary systems. It is widely used in computer systems to perform arithmetic operations such as addition and subtraction efficiently. The two's complement representation allows for the encoding of both positive and negative integers using the same binary format.

New to topics? Read the docs here!