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

Some numbers with a finite representation in base 10, 0.2, for example, don't have a finite representation in base 2.

They are rounded, and doing arithmetic on such numbers leads to compounded rounding errors that you don't want to see when dealing with money.

Another problem is that the mantissa of floating point numbers is limited (52 bits for doubles), which can lead to truncated numbers, another big no no.



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: