static floorLg2(n) {
        if (n <= 1) {
            return 0;
        }
        let p = Math.floor(Math.log2(n));
        if (1<<(p+1) <= n) {
            return p + 1;
        }
        if (n < 1<<p) {
            return p - 1;
        }
        return p;
    }
@param {!int} n
@returns {!int} A value p such that 2**p <= n < 2**(p+1).