from typing import Union


def clamp(value: Union[int, float], min_: Union[int, float], max_: Union[int, float]) -> Union[int, float]:
    """
    Clamps the value between minimum and maximum values.
    :param value: number to clamp
    :param min_: minimum value
    :param max_: maximum value
    :return: clamped number
    """
    # If inside the boundaries, return the actual value
    if min_ <= value <= max_:
        return value
    # When going over the boundary, return min/max
    elif value < min_:
        return min_
    else:
        return max_