Skip to content

Commit fdb0acc

Browse files
committed
Merged revisions 82221 via svnmerge from
svn+ssh://[email protected]/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. ........
1 parent 88968ad commit fdb0acc

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

Modules/mathmodule.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -989,17 +989,17 @@ _fsum_realloc(double **p_ptr, Py_ssize_t n,
989989
def msum(iterable):
990990
partials = [] # sorted, non-overlapping partial sums
991991
for x in iterable:
992-
i = 0
993-
for y in partials:
994-
if abs(x) < abs(y):
995-
x, y = y, x
996-
hi = x + y
997-
lo = y - (hi - x)
998-
if lo:
999-
partials[i] = lo
1000-
i += 1
1001-
x = hi
1002-
partials[i:] = [x]
992+
i = 0
993+
for y in partials:
994+
if abs(x) < abs(y):
995+
x, y = y, x
996+
hi = x + y
997+
lo = y - (hi - x)
998+
if lo:
999+
partials[i] = lo
1000+
i += 1
1001+
x = hi
1002+
partials[i:] = [x]
10031003
return sum_exact(partials)
10041004
10051005
Rounded x+y stored in hi with the roundoff stored in lo. Together hi+lo

0 commit comments

Comments
 (0)