public void accept(double x){
  if (Double.isNaN(x)) {
    return;
  }
  n++;
  if (n == 1) {
    m=x;
    s=0.0;
  }
 else {
    double oldM=m;
    double oldS=s;
    m=oldM + (x - oldM) / n;
    s=oldS + (x - oldM) * (x - m);
  }
  max=Math.max(max,x);
  min=Math.min(min,x);
}

public void accept ( double x ) { if ( Double . isNaN ( x ) ) { return ; } n ++ ; if ( n == 1 ) { m = x ; s = 0.0 ; } else { double oldM = m ; double oldS = s ; m = oldM + ( x - oldM ) / n ; s = oldS + ( x - oldM ) * ( x - m ) ; } max = Math . max ( max , x ) ; min = Math . min ( min , x ) ; }
adds a value and updates the statistics . if the input value is a nan , it is ignored .
