EN
JavaScript - max Number value
10 points
JavaScript API provides predefined constants that represent maximal positive possible Number
values.
JavaScript number type combines together integer and floating-point values - Virtual Machine decides how to keep the numbers.
Property | Value | Description |
Number.MAX_SAFE_INTEGER | 9007199254740991 | Math.pow(2, 53) - 1 |
Number.MAX_VALUE | 1.7976931348623157e+308 | |
Number.POSITIVE_INFINITY | Infinity | 1/0 |
Note: for larger integer numbers use
BigInt
.
Practical example:
xxxxxxxxxx
1
console.log(Number.MAX_SAFE_INTEGER); // 9007199254740991
2
console.log(Number.MAX_VALUE); // 1.7976931348623157e+308
3
console.log(Number.POSITIVE_INFINITY); // Infinity