clamp ( x min max -- y )
Factor handbook > The language > Objects > Linear order protocol

Prev:max ( obj1 obj2 -- obj )
Next:Linear order example


Vocabulary
math.order

Inputs and outputs
xan object
minan object
maxan object
yan object


Word description
Outputs x if contained in the interval [min,max] or else outputs one of the endpoints.

Definition