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

It's somewhat acceptable with double precision floats - never single precision floats.

But far better to just use integer cents.



Integer cents implies a specific rounding mode (truncation). That's probably not what you should be using. Floating point cents gets the best of both worlds (if you set the right rounding mode).




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: