Package it.unimi.dsi.util
Class KahanSummation
- java.lang.Object
-
- it.unimi.dsi.util.KahanSummation
-
public class KahanSummation extends java.lang.Object
Kahan's summation algorithm encapsulated in an object.
-
-
Constructor Summary
Constructors Constructor Description KahanSummation()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(double v)
Adds a value.void
reset()
Resets the current value and correction to zero.double
value()
Returns the sum computed so far.
-