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

A more general way to do that is Kahan summation[1], where you keep track of the rounding errors made so far.

[1]: https://en.wikipedia.org/wiki/Kahan_summation_algorithm




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

Search: