JS Built-ins
NumberEPSILONintermediate

Number.EPSILON β€” the value

πŸ“– Usage Example
// Use EPSILON to compare floats safely
0.1 + 0.2 === 0.3   // β†’ false (floating-point issue)
Math.abs(0.1 + 0.2 - 0.3) < Number.EPSILON   // β†’ true

Use Number.EPSILON as a tolerance threshold when comparing floating-point numbers that may differ by tiny rounding errors.

Number.EPSILON

Number.EPSILON is the smallest difference between two representable floating-point numbers: approximately 2.220446049250313e-16.

Challenge: Verify the value of Number.EPSILON.

πŸ’‘ Hints (1)
  • β€’ `Number.EPSILON` represents the gap between 1 and the next representable float.