Glossary term
What is two's complement? Meaning for developers
In DSA
The usual way to store negative whole numbers. The top bit is the sign.
Learn it properly · DSALesson 58: Tries and Bit ManipulationPrefix trees, and the bit tricks that interviews ask about.In CS Foundations
The usual way to store negative integers in binary.
Learn it properly · CS FoundationsLesson 4: Binary, Endianness and Bit TricksReading binary and hex, two's complement, JavaScript's 32-bit bitwise operators, masks, endianness and DataView.