import math


def binaryWidth(n):
    """Compute length of binary representation of an integer.
    """
    # can't take log of 0.
    if n == 0:
        return 1
    
    # Use + 1 to account for 2^0
    width = math.floor(math.log(n, 2)) + 1
    
    return width