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

Just say (0.1+0.2)*10-3. That works everywhere no matter the amount of rounding.


You've just invented fixed point numbers.


I'm not sure I follow? The point here was to show that a language can't represent the decimal fractions exactly.


But they can. Many languages have decimal and rational types.




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

Search: