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