def median(l):
    """Calculate median value of the list

    Args:
        l (list of float): List of numbers
    """
    length = len(l)
    sorted_l = sorted(l)
    index = (length - 1) // 2
    if length % 2 == 0:
        return (sorted_l[index] + sorted_l[index + 1]) / 2.0
    else:
        return sorted_l[index]
