JavaScript: Number.EPSILON and Number.MAX_SAFE_INTEGER
EPSILON The Number.EPSILON property represents the difference between 1 and the smallest floating point number greater than 1 > Number.EPSILON == Math.pow(2, -52) true Use Number.EPSILON to test floating point number equality. x = 0.2; y = 0.3; z = 0.1; equal = (Math.abs(x – y + z) < Number.EPSILON); https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/EPSILON MAX_SAFE_INTEGER & MIN_SAFE_INTEGER The MAX_SAFE_INTEGER constant has a …
JavaScript: Number.EPSILON and Number.MAX_SAFE_INTEGER Read More »