eps
Floating-point relative accuracy (machine epsilon).
Syntax
Section titled “Syntax”y = epsy = eps(X)Description
Section titled “Description”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.
Examples
Section titled “Examples”eps % 2.2204e-16abs(0.1 + 0.2 - 0.3) < eps % 1 (tolerance check)eps(1e10) % ≈ 1.86e-6 (gap at 1e10)