Class KahanSummation


public class KahanSummation
extends Object
Kahan's summation algorithm encapsulated in an object.
  • Constructor Details

    • KahanSummation

      public KahanSummation()
  • Method Details

    • add

      public void add​(double v)
      Adds a value.
      v - the value to be added to the sum.
    • value

      public double value()
      Returns the sum computed so far.
      the sum computed so far.
    • reset

      public void reset()
      Resets the current value and correction to zero.