Number.EPSILON
The Number.EPSILON
property represents the difference between 1 and the smallest floating point number greater than 1.
Value
2-52, or approximately 2.2204460492503130808472633361816E-16
.
Description
Number.EPSILON
is the difference between 1 and the next greater number representable in the Number format, because double precision floating point format only has 52 bits to represent the mantissa, and the lowest bit has a significance of 2-52.
Note that the absolute accuracy of floating numbers decreases as the number gets larger, because the exponent grows while the mantissa's accuracy stays the same. Number.MIN_VALUE
is the smallest representable positive number, which is much smaller than Number.EPSILON
.
Because EPSILON
is a static property of Number
, you always use it as Number.EPSILON
, rather than as a property of a number value.