mirror of
https://github.com/RGBCube/serenity
synced 2025-05-20 18:15:07 +00:00
LibJS: Add Number constants
This commit is contained in:
parent
f85aa8462f
commit
b7032b4972
2 changed files with 22 additions and 0 deletions
15
Libraries/LibJS/Tests/Number-constants.js
Normal file
15
Libraries/LibJS/Tests/Number-constants.js
Normal file
|
@ -0,0 +1,15 @@
|
|||
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);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue