public void add(double value){
  if (value < lower || Double.isNaN(lower)) {
    lower=value;
  }
  if (value > upper || Double.isNaN(upper)) {
    upper=value;
  }
}

public void add ( double value ) { if ( value < lower || Double . isNaN ( lower ) ) { lower = value ; } if ( value > upper || Double . isNaN ( upper ) ) { upper = value ; } }
this method increases the range size , if the value is not lying in between
