How best to sum up lots of floating point numbers?

For “more precise”: this recipe in the Python Cookbook has summation algorithms which keep the full precision (by keeping track of the subtotals). Code is in Python but even if you don’t know Python it’s clear enough to adapt to any other language.

All the details are given in this paper.

Leave a Comment