Skip to content

eps

Floating-point relative accuracy (machine epsilon).

y = eps
y = eps(X)

Returns the distance from 1.0 to the next larger double-precision number — about 2.2204e-16. With argument X, returns the distance from X to the next representable number of the same type. Useful for tolerance-based comparisons.

eps % 2.2204e-16
abs(0.1 + 0.2 - 0.3) < eps % 1 (tolerance check)
eps(1e10) % ≈ 1.86e-6 (gap at 1e10)
  • realmin — Smallest positive normalized floating-point number.
  • realmax — Largest positive finite floating-point number.
  • pi — Mathematical constant π.