clamp

Clamps a value to specific bounds.

Inputs

value

The value to clamp.

min

The minimum value allowed for the output.

max

The maximum value allowed for the output.

Output

clamped

If the value is smaller than min, the output is min. If the value is greater than max, the output is max. In all other cases, the output is the input value.