Skip to content
Free public beta until December 4, 2026: every course is open, no card needed. After that, the first chapter of each course stays free and full access is a one-time $39 ($19 for up to 100 founding members chosen for helpful feedback). Your progress is kept. How the beta works

machine epsilon

The gap between 1.0 and the next float above it - about 1.2 * 10^-7 for float and 2.2 * 10^-16 for double.

Machine epsilon is ulp(1) = 2^(1 - p), returned by std::numeric_limits::epsilon() (2^-23 for float, 2^-52 for double); the relative rounding error of one correctly rounded operation is at most half of it.

Examples

  • For double, machine epsilon is 2⁻⁵², about 2.22 × 10⁻¹⁶.

Read the full section →