How the Binary Calculator Computes Each Operation
AnyTool Binary Calculator runs a pure, unit-tested programmer engine entirely in the browser, with binary as the default base. Each operand — typed in binary, decimal, octal or hexadecimal — is parsed into a single canonical BigInt, so every bit is exact even for 64-bit values that would round under JavaScript’s 53-bit doubles. The value is then masked to the chosen word size to produce the unsigned bit pattern a register would hold. Arithmetic (add, subtract, multiply, integer divide and modulo) is performed on the signed two’s-complement interpretation and truncates toward zero like C; bitwise AND, OR, XOR and NOT act on the raw patterns; left and right shifts are logical shifts on the masked value. Every result is wrapped back to the word width and presented in binary first, and the same base-agnostic engine powers the Hex Calculator.
- Operands parsed to exact BigInt, then masked to the word size
- Arithmetic uses signed two’s complement; division truncates toward zero
- Bitwise AND/OR/XOR/NOT on raw patterns; logical left/right shifts
- Results wrapped to 8/16/32/64 bits like a hardware register
- Same base-agnostic engine as the Hex Calculator, binary-first UI
