📜  MAX_SAFE_INTEGER - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:14.983000             🧑  作者: Mango

代码示例1
// Within this limit we can do our calculations safely with precision
// After MAX_SAFE_INTEGER limit, use BigInt value type.

console.log(Number.MAX_SAFE_INTEGER);     // (2^53 - 1) => 9007199254740991
console.log(Number.MIN_SAFE_INTEGER);     // (-(2^53 - 1)) => -9007199254740991