diff options
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/math.rst | 20 | ||||
-rw-r--r-- | Doc/whatsnew/2.6.rst | 2 |
2 files changed, 11 insertions, 11 deletions
diff --git a/Doc/library/math.rst b/Doc/library/math.rst index 61a6fd6..5740759 100644 --- a/Doc/library/math.rst +++ b/Doc/library/math.rst @@ -83,6 +83,16 @@ Number-theoretic and representation functions: apart" the internal representation of a float in a portable way. +.. function:: fsum(iterable) + + Return an accurate floating point sum of values in the iterable. Avoids + loss of precision by tracking multiple intermediate partial sums. The + algorithm's accuracy depends on IEEE-754 arithmetic guarantees and the + typical case where the rounding mode is half-even. + + .. versionadded:: 2.6 + + .. function:: isinf(x) Checks if the float *x* is positive or negative infinite. @@ -112,16 +122,6 @@ Number-theoretic and representation functions: *x*, and both are floats. -.. function:: sum(iterable) - - Return an accurate floating point sum of values in the iterable. Avoids - loss of precision by tracking multiple intermediate partial sums. The - algorithm's accuracy depends on IEEE-754 arithmetic guarantees and the - typical case where the rounding mode is half-even. - - .. versionadded:: 2.6 - - .. function:: trunc(x) Return the :class:`Real` value *x* truncated to an :class:`Integral` (usually diff --git a/Doc/whatsnew/2.6.rst b/Doc/whatsnew/2.6.rst index a8d89cb..9959ecd 100644 --- a/Doc/whatsnew/2.6.rst +++ b/Doc/whatsnew/2.6.rst @@ -1537,7 +1537,7 @@ Here are all of the changes that Python 2.6 makes to the core Python language. * :func:`~math.factorial` computes the factorial of a number. (Contributed by Raymond Hettinger; :issue:`2138`.) - * :func:`~math.sum` adds up the stream of numbers from an iterable, + * :func:`~math.fsum` adds up the stream of numbers from an iterable, and is careful to avoid loss of precision by calculating partial sums. (Contributed by Jean Brouwers, Raymond Hettinger, and Mark Dickinson; :issue:`2819`.) |