[issue2819] Full precision summation
report at bugs.python.org
Sat Aug 2 10:57:14 CEST 2008
Mark Dickinson <dickinsm at gmail.com> added the comment:
> Question: I see "math module patch committed, r63542" in May 22. But in
> 3.0b2, there is no math.fsum and math.sum seems to be a wrapper for
> builtin sum. Has this not been forward ported (merged) yet?
I'm pretty sure it *was* merged: math.sum should be the full-precision
summation in both recent betas (2.6b2 and 3.0b2). Try comparing
sum([1e100, 1, -1e100, -1]) and math.sum([1e100, 1, -1e100, -1])---they
should produce -1.0 and 0.0 respectively.
The name change to fsum only happened in the last few days.
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list