hwt/code.py
def log2ceil(x):
    """
    Returns no of bits required to store x-1
    for example x=8 returns 3
    """

    if not isinstance(x, (int, float)):
        x = int(x)

    if x == 0 or x == 1:
        res = 1
    else:
        res = math.ceil(math.log2(x))

    return hInt(res)
def log2ceil(x):
    if not isinstance(x, (int, float)):
        x = int(x)

    if x == 0 or x == 1:
        res = 1
    else:
        res = math.ceil(math.log2(x))

    return hInt(res)
def log2ceil ( x ) : if not isinstance ( x , ( int , float ) ) : x = int ( x ) if x == 0 or x == 1 : res = 1 else : res = math . ceil ( math . log2 ( x ) ) return hInt ( res )
Returns no of bits required to store x-1
    for example x=8 returns 3
Returns no of bits required to store x - 1 for example x = 8 returns 3