public static double ceil(double x){
  double y;
  if (Double.isNaN(x)) {
    return x;
  }
  y=floor(x);
  if (y == x) {
    return y;
  }
  y+=1.0;
  if (y == 0) {
    return x * y;
  }
  return y;
}

public static double ceil ( double x ) { double y ; if ( Double . isNaN ( x ) ) { return x ; } y = floor ( x ) ; if ( y == x ) { return y ; } y += 1.0 ; if ( y == 0 ) { return x * y ; } return y ; }
get the smallest whole number larger than x .
