public static int magnitude(int v){
  return Integer.SIZE - Integer.numberOfLeadingZeros(v);
}

public static int magnitude ( int v ) { return Integer . SIZE - Integer . numberOfLeadingZeros ( v ) ; }
the magnitude is the position of the highest bit set
