@Test public void binLength() { assertTrue(BitUtils.binLength(10) == 4); assertTrue(BitUtils.binLength(0) == 1); assertTrue(BitUtils.binLength(2) == 2); assertTrue(BitUtils.binLength(8) == 4); }
public static int binLength(int n) { int len = 1; while (n >> len > 0) { len += 1; } return len; }
BitUtils { public static int binLength(int n) { int len = 1; while (n >> len > 0) { len += 1; } return len; } }
BitUtils { public static int binLength(int n) { int len = 1; while (n >> len > 0) { len += 1; } return len; }  }
BitUtils { public static int binLength(int n) { int len = 1; while (n >> len > 0) { len += 1; } return len; }  static boolean isPowerOf2(int n); static int binLength(int n); }
BitUtils { public static int binLength(int n) { int len = 1; while (n >> len > 0) { len += 1; } return len; }  static boolean isPowerOf2(int n); static int binLength(int n);  }