Hacker News new | past | comments | ask | show | jobs | submit login

Yep, there are only doubles in JavaScript. With doubles, integer values work fine up to 2^53. After that point, things get silly.

    >>> Math.pow(2, 53) === Math.pow(2, 53) - 1
    false
    >>> Math.pow(2, 53) === Math.pow(2, 53)
    true
    >>> Math.pow(2, 53) === Math.pow(2, 53) + 1
    true // derp



Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: