Class KahanSummation

    • 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • KahanSummation

        public KahanSummation()
    • Method Detail

      • 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.