Clamp
This function clamps a number between a minimum and maximum limit and returns the result.
Syntax
- number Clamp(number f, number min=0, number max=1)
Parameters
- f: the number to clamp.
- min: the lower limit.
- max: the upper limit.
Returns
If the number f is less than the min, the min is returned. If the number f is greater than the max, the max is returned. Otherwise, f is returned.