Package it.unimi.dsi.util
Class KahanSummation
java.lang.Object
it.unimi.dsi.util.KahanSummation
Kahan's
summation algorithm encapsulated in an object.
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
KahanSummation
public KahanSummation()
-
-
Method Details
-
add
public void add(double v) Adds a value.- Parameters:
v
- the value to be added to the sum.
-
value
public double value()Returns the sum computed so far.- Returns:
- the sum computed so far.
-
reset
public void reset()Resets the current value and correction to zero.
-