public final static int logBase2(double number){
  int log=0;
  while (number > 1) {
    number=Math.floor(number / 2);
    ++log;
  }
  return log;
}

public final static int logBase2 ( double number ) { int log = 0 ; while ( number > 1 ) { number = Math . floor ( number / 2 ) ; ++ log ; } return log ; }
returns the largest integer n , such that 2 ^ n < = the specified number .
