public static int toLog2(int value,String argName){
  checkIfPowerOf2(value,argName);
  return Integer.numberOfTrailingZeros(value);
}

public static int toLog2 ( int value , String argName ) { checkIfPowerOf2 ( value , argName ) ; return Integer . numberOfTrailingZeros ( value ) ; }
checks the given value if it is a power of 2 . if not , it throws an exception . otherwise , returns the log - base2 of the given value .
