How the Hex Calculator Computes Each Operation
AnyTool Hex Calculator runs a pure, unit-tested programmer engine entirely in the browser. Each operand — typed in hexadecimal, decimal, octal or binary — is parsed into a single canonical BigInt, so every digit is exact even for 64-bit values such as 0xFFFFFFFFFFFFFFFF 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 the same engine is shared with the Binary Calculator because it is base-agnostic.
- 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
- Base-agnostic engine shared with the Binary Calculator
