To find the machine epsilon value for JavaScript, use Number.EPSILON
. This is effectively the maximum possible rounding error for floating point numbers.
// Number.EPSILON
Math.abs(0.2 - 0.3 + 0.1) < Number.EPSILON
// true
See the docs.
To find the machine epsilon value for JavaScript, use Number.EPSILON
. This is effectively the maximum possible rounding error for floating point numbers.
// Number.EPSILON
Math.abs(0.2 - 0.3 + 0.1) < Number.EPSILON
// true
See the docs.