def _log2(n):
    """Make table of logs reach up to n and return floor(log_2(n))."""
    while len(_logtable) <= n:
        _logtable.extend([1+_logtable[-1]]*len(_logtable))
    return _logtable[n]
Make table of logs reach up to n and return floor(log_2(n)).
recipes/Python/252123_Range_minimleast/recipe-252123.py