A function to return ceiling of log x in base 2. For example , it returns 3 for 8 and 4 for 9.
def ceilLog2 ( x ) : NEW_LINE INDENT count = 0 NEW_LINE x = x - 1 NEW_LINE while ( x > 0 ) : NEW_LINE INDENT x = x >> 1 NEW_LINE count = count + 1 NEW_LINE DEDENT return count NEW_LINE DEDENT