Round-Off Error

Total Bits
Integer: 4 bits Bit Allocation Fraction: 4 bits

Binary Representation

Integer Fraction
23 8
22 4
21 2
20 1
  .  
2-1 0.5
2-2 0.25
2-3 0.125
2-4 0.0625

Click any bit to toggle it manually

Results

Original Value
1.76
Stored Value
1.75
Round-Off Error
0.01
Error %
0.57%
Smallest step (precision): 0.0625 (2-4)

All Possible Splits (8 total bits)

Same number, same total bits, different allocations. See how the split affects accuracy.

SplitBinaryStoredErrorError %
1i / 7f 1.11000011.757813 0.0021880.12%
2i / 6f 01.1100001.75 0.010.57%
3i / 5f 001.110001.75 0.010.57%
4i / 4f \u21900001.11001.75 0.010.57%
5i / 3f 00001.1101.75 0.010.57%
6i / 2f 000001.111.75 0.010.57%
7i / 1f 0000001.11.5 0.2614.77%

Famous Round-Off Errors

0.1 + 0.2 ≠ 0.3

In JavaScript: 0.1 + 0.2 = 0.30000000000000004. The number 0.1 cannot be exactly represented in binary!

The Patriot Missile Bug (1991)

A 0.1-second timing error accumulated over 100 hours, causing a 0.34-second drift that led to a failed missile interception.

Currency: $9.99

This is why financial systems store cents as integers (999) instead of floating-point dollars (9.99).