Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: