Files
pplus-library/modules/numerics/kahan-sum/ref/python/plain.py
T
alexm 568474d52f
Test (in pplus-core) / in-core (push) Failing after 28m44s
Initial commit
2026-11-12 22:23:48 -05:00

10 lines
165 B
Python

def kahan_sum(x):
total = 0.0
c = 0.0
for v in x:
y = v - c
t = total + y
c = (t - total) - y
total = t
return total