Machine epsilon is the smallest floating-point value eps
such that 1+eps > 1 in the machine's arithmetic. Starting
from eps=2^-49 and halving repeatedly, the test 1+eps=1.0
first becomes true at eps=2^-53, confirming machine epsilon
is 2^-52 (approximately 2.220e-16) for IEEE 754 double.
Example
Halve epsilon until adding it to 1 no longer changes the floating-point value.
highlighted = computed this step
Step 1 — Set up
Start halving epsilon from 2 to the -49.
ϵstart=2−49
Step 2 — Halving 1
Add halving row 1 to the table.
n1eps2−50mantissa8.882ten exp−16testNO
Step 3 — Halving 2
Add halving row 2 to the table.
n12eps2−502−51mantissa8.8824.441ten exp−16−16testNONO
Step 4 — Halving 3
Add halving row 3 to the table.
n123eps2−502−512−52mantissa8.8824.4412.220ten exp−16−16−16testNONONO
Step 5 — Halving 4
Add halving row 4 to the table.
n1234eps2−502−512−522−53mantissa8.8824.4412.2201.110ten exp−16−16−16−16testNONONOYES
Step 6 — Machine epsilon
The last working epsilon is 2 to the -52.
ϵmach=2.220×10−16=2−52
machine-epsilon-halving
IEEE 754 double precision stores 52 mantissa bits. The smallest difference between 1.0 and the next representable number is 2^-52 ≈ 2.22e-16 (machine epsilon). Halve eps until 1+eps rounds to 1 in floating-point; the last eps where 1+eps > 1 equals machine epsilon.