math.fsum: summing multiple running sums at once

April 27, 2010
5:55 p.m.
A suggestion: extend math.fsum to accept an iterable that yields tuples of floats, and returns a tuple of sums. This would permit summing multiple running sums at once (e.g. keeping both a sum and a sum-of-squares for computing standard deviation from an iterable), or summing a stream of complex numbers. An alternative would be to make an object-oriented version of fsum that has a method for adding a number to the sum; then an array of such objects could be used to sum multiple iterables simultaneously. It would also be good if other methods based on fsum were included in the standard library, e.g. for accurately computing the mean and stddev of an iterable. Thanks, ilya
5415
Age (days ago)
5417
Last active (days ago)
1 comments
2 participants
participants (2)
-
Ilya Shlyakhter
-
Mark Dickinson