From: Mark Dickinson Date: Fri, 25 Jun 2010 20:22:24 +0000 (+0000) Subject: Merged revisions 82221 via svnmerge from X-Git-Tag: v3.2a1~459 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fdb0accc314f0e6834228379546b5427bb460bf6;p=python Merged revisions 82221 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r82221 | mark.dickinson | 2010-06-25 21:19:48 +0100 (Fri, 25 Jun 2010) | 1 line Fix indentation of Python code example in C comment. ........ --- diff --git a/Modules/mathmodule.c b/Modules/mathmodule.c index bc3f5ddcdb..ef6980f3b6 100644 --- a/Modules/mathmodule.c +++ b/Modules/mathmodule.c @@ -989,17 +989,17 @@ _fsum_realloc(double **p_ptr, Py_ssize_t n, def msum(iterable): partials = [] # sorted, non-overlapping partial sums for x in iterable: - i = 0 - for y in partials: - if abs(x) < abs(y): - x, y = y, x - hi = x + y - lo = y - (hi - x) - if lo: - partials[i] = lo - i += 1 - x = hi - partials[i:] = [x] + i = 0 + for y in partials: + if abs(x) < abs(y): + x, y = y, x + hi = x + y + lo = y - (hi - x) + if lo: + partials[i] = lo + i += 1 + x = hi + partials[i:] = [x] return sum_exact(partials) Rounded x+y stored in hi with the roundoff stored in lo. Together hi+lo