def validate_distance(distance: float) -> float:
    """
    Validates the distance of an object.

    :param distance: The distance of the object.
    :return: The validated distance.
    """
    if distance < 0:
        raise ValueError("The distance must be zero or positive.")

    return distance