public static double floor(double x){
  long y;
  if (Double.isNaN(x)) {
    return x;
  }
  if (x >= TWO_POWER_52 || x <= -TWO_POWER_52) {
    return x;
  }
  y=(long)x;
  if (x < 0 && y != x) {
    y--;
  }
  if (y == 0) {
    return x * y;
  }
  return y;
}

public static double floor ( double x ) { long y ; if ( Double . isNaN ( x ) ) { return x ; } if ( x >= TWO_POWER_52 || x <= - TWO_POWER_52 ) { return x ; } y = ( long ) x ; if ( x < 0 && y != x ) { y -- ; } if ( y == 0 ) { return x * y ; } return y ; }
get the largest whole number smaller than x .
