import math


def bits_required(int_value: int) -> int:
    """
    Calculates the bits required to store the int value.

    Arguments:
    int_value (int) - The value of the bit array.

    Return:
    int             - The length of the bit array.
    """
    if int_value < 2:
        return 1
    elif int_value == 2:
        return 2
    else:
        return math.ceil(math.log2(int_value))