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

For summation just go with Kahan summation or some improved variant of it https://en.wikipedia.org/wiki/Kahan_summation_algorithm


And if you can't remember that, you can use a pairwise summation like (((a+b)+(c+d))+((e+f)+(g+h)))+... which gives a decent error reduction in return.




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

Search: