returns position of the highest set bit of a number ref https graphics stanford eduseanderbithacks htmlintegerlogobvious gethighestsetbitposition25 5 gethighestsetbitposition37 6 gethighestsetbitposition1 1 gethighestsetbitposition4 3 gethighestsetbitposition0 0 gethighestsetbitposition0 8 traceback most recent call last typeerror input value must be an int type returns position of the highest set bit of a number ref https graphics stanford edu seander bithacks html integerlogobvious get_highest_set_bit_position 25 5 get_highest_set_bit_position 37 6 get_highest_set_bit_position 1 1 get_highest_set_bit_position 4 3 get_highest_set_bit_position 0 0 get_highest_set_bit_position 0 8 traceback most recent call last typeerror input value must be an int type
def get_highest_set_bit_position(number: int) -> int:
    
    if not isinstance(number, int):
        raise TypeError("Input value must be an 'int' type")

    position = 0
    while number:
        position += 1
        number >>= 1

    return position


if __name__ == "__main__":
    import doctest

    doctest.testmod()