4 ms·
Python promote to Bignum automatically. Javascript number is a floating point Number.MAX_SAFE_INTEGER // 9007199254740991 Number.MAX_SAFE_INTEGER
by sergeykish 6y ago
Python promote to Bignum automatically.
Javascript number is a floating point
Number.MAX_SAFE_INTEGER
// 9007199254740991
Number.MAX_SAFE_INTEGER + 1
// 9007199254740992
Number.MAX_SAFE_INTEGER + 2
// 9007199254740992
no automatic promotion to BigInt
9007199254740991n + 2n
// 9007199254740993n