def calculate_midpoint(l, r):
    """
    @param l left index, included in the range of elements to consider
    @param r right index, included in range of elements to consider
    @return None if there's no elements to range over.

    Returns the midpoint from the "left side" or "left half" if there's an even
    number of elements.

    @details index = l, l+1, ... r are all included indices to consider.
    """
    # Get the total number of elements to consider.
    L  = r - l + 1
    if (L <= 0):
        return None

    return (L//2 + l) if (L % 2  == 1) else (L//2 - 1 + l)