Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
zokier
on Feb 19, 2024
|
parent
|
context
|
favorite
| on:
Floats Are Weird
For summation just go with Kahan summation or some improved variant of it
https://en.wikipedia.org/wiki/Kahan_summation_algorithm
lifthrasiir
on Feb 19, 2024
[–]
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: