大整形
时间:2021-05-24 23:16:37
收藏:0
阅读:29
// 大整形
// let n = 521n;
// console.log(n,typeof(n));
// 函数
// let n = 123;
// console.log(BigInt(n));
// 大数值 运算
let max = Number.MAX_SAFE_INTEGER;
console.log(max); // 9007199254740991
console.log(max + 1); // 9007199254740992
console.log(max + 2); // 9007199254740992
console.log(BigInt(max)); // 9007199254740991n
console.log(BigInt(max) + BigInt(1)); // 9007199254740992n
console.log(BigInt(max) + BigInt(2)); // 9007199254740993n
原文:https://www.cnblogs.com/eric-share/p/14805918.html
评论(0)