summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorMark Dickinson <dickinsm@gmail.com>2010-06-25 20:21:43 (GMT)
committerMark Dickinson <dickinsm@gmail.com>2010-06-25 20:21:43 (GMT)
commit82842cc46e6a117ffd58c1b546db55a27cadef26 (patch)
tree83a14701d354bd8867042105e3d3691092f06ddd /Modules
parentb4f0e644bcec625d3bb7964d391ddd363083f2d1 (diff)
downloadcpython-82842cc46e6a117ffd58c1b546db55a27cadef26.zip
cpython-82842cc46e6a117ffd58c1b546db55a27cadef26.tar.gz
cpython-82842cc46e6a117ffd58c1b546db55a27cadef26.tar.bz2
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. ........
Diffstat (limited to 'Modules')
-rw-r--r--Modules/mathmodule.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/Modules/mathmodule.c b/Modules/mathmodule.c
index 13d6e62..4b51ee9 100644
--- a/Modules/mathmodule.c
+++ b/Modules/mathmodule.c
@@ -435,17 +435,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