home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
forth
/
compiler
/
fpc
/
source
/
p3_10dc.seq
< prev
next >
Wrap
Text File
|
1990-04-05
|
709b
|
24 lines
\ Answer for problem 3.10 by Dickson Cheng 04/04/90 21:30:34.56
\ If the interval testing words are used with invalid internals
\ the flag will always be false.
\ (IN) leaves a true flag if a < x < b , otherwise false.
: (IN) ( x a b -- flag )
OVER 1 PICK > IF SWAP THEN
-ROT OVER < -ROT > AND ;
\ [IN] leaves a true flag if a <= x <= b , otherwise false.
: [IN] ( x a b -- flag )
1+ SWAP 1- SWAP (IN) ;
\ (IN] leaves a true flag if a < x <= b , otherwise false.
: (IN] ( x a b -- flag )
1+ (IN) ;
\ [IN) leaves a true flag if a <= x < b , otherwise false.
: [IN) ( x a b -- flag )
SWAP 1- SWAP (IN) ;