public static int scan(int v){
  return 31 - Integer.numberOfLeadingZeros(v);
}

public static int scan ( int v ) { return 31 - Integer . numberOfLeadingZeros ( v ) ; }
utility method with defined return value for 0 .
