Kahan summation: Difference between revisions

→‎{{header|Python}}: Contrast Pythons sum()
(→‎{{header|Python}}: getcontext.)
(→‎{{header|Python}}: Contrast Pythons sum())
Line 32:
>>> kahansum([a, b, c])
Decimal('10005.9')
>>>
>>>
>>> sum([a, b, c])
Decimal('10005.8')
>>> # it seems Python's sum() doesn't make use of this technique.
>>>
>>> # More info on the current Decimal context:
Anonymous user