ladybird/Libraries/LibJS/Tests/Number-constants.js
2020-04-07 21:28:43 +02:00

15 lines
541 B
JavaScript

try {
assert(Number.EPSILON === 2 ** -52);
assert(Number.EPSILON > 0);
assert(Number.MAX_SAFE_INTEGER === 2 ** 53 - 1);
assert(Number.MAX_SAFE_INTEGER + 1 === Number.MAX_SAFE_INTEGER + 2);
assert(Number.MIN_SAFE_INTEGER === -(2 ** 53 - 1));
assert(Number.MIN_SAFE_INTEGER - 1 === Number.MIN_SAFE_INTEGER - 2);
assert(Number.POSITIVE_INFINITY === Infinity);
assert(Number.NEGATIVE_INFINITY === -Infinity);
assert(isNaN(Number.NaN));
console.log("PASS");
} catch (e) {
console.log("FAIL: " + e);
}