Handbook
Glossary
between? ( x min max -- ? )
Factor handbook
»
The language
»
Numbers
»
Mathematical functions
»
Arithmetic functions
Prev:
zero? ( x -- ? )
Next:
if-zero ( ..a n quot1: ( ..a -- ..b ) quot2: ( ..a n -- ..b ) -- ..b )
Vocabulary
math
.
order
Inputs
x
an
object
min
an
object
max
an
object
Outputs
?
a
boolean
Word description
Tests if
x
is in the interval
[min,max]
.
Notes
As per the closed interval notation, the end-points are included in the interval.
Definition
USING:
kernel
;
IN:
math.order
:
between?
( x min max -- ? )
pick
after=?
[
after=?
]
[
2drop
f
]
if
;
inline