clamp

ABSTRACT

Clamps an input to a range. The value of l should be less than or equal to the value of r

PARAMETERS
lthe number denoting the start of the range
xthe number that we want to clamp
rthe number denoting the end of the range
RETURN

r if x is greater than r, l if x is less than l, and otherwise x is returne

DECLARATION
func clamp(l, x, r)