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

While you are correct that it can _represent_ these numbers with that precision... it cannot operate on them and retain that precision, so DO NOT USE FLOATS TO REPRESENT MONEY. Thank you for your time.

    let a = 35
    let b = -34.99

    console.log(a+b)

    // output: 0.00999999999999801


Brr almost got the shivers until I read your comment




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

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

Search: