public class BitTools { /** @return the ceiling of the binary logarithm of x */ public static final int lb(int x) { int lb; for (lb = 0; x > 0; ++lb, x = x >> 1); return lb; } private BitTools() {} // this class is not meant to be instantiated }