Handbook
Glossary
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
x
an
object
min
an
object
max
an
object
Outputs
y
an
object
Word description
Outputs
x
if contained in the interval
[min,max]
or else outputs one of the endpoints.
Definition
USING:
kernel
;
IN:
math.order
:
clamp
( x min max -- y )
[
max
]
dip
min
;
inline