version 1.4, 2007/08/28 19:15:03

version 1.7, 2007/11/02 12:44:49

Line 41

Line 41



\ There are a few things to be noted: 
\ There are a few things to be noted: 


\  Following the despicable practice of the original, this version 
\  Loading ttester.fs does not change BASE. Loading tester.fs 
\ sets the base to HEX for everything that gets loaded later. 
\ changes BASE to HEX (like the original tester). Floatingpoint 
\ Floatingpoint input is ambiguous when the base is not decimal, so 
\ input is ambiguous when the base is not decimal, so you have to set 
\ you have to set it to decimal yourself when you want to deal with 
\ it to decimal yourself when you want to deal with decimal numbers. 
\ decimal numbers. 



\  For FP it is often useful to use approximate equality for checking 
\  For FP it is often useful to use approximate equality for checking 
\ the results. You can turn on approximate matching with SETNEAR 
\ the results. You can turn on approximate matching with SETNEAR 
Line 101 HASFLOATING [IF]

Line 100 HASFLOATING [IF]

\ SET THE FOLLOWING TO THE RELATIVE AND ABSOLUTE TOLERANCES YOU 
\ SET THE FOLLOWING TO THE RELATIVE AND ABSOLUTE TOLERANCES YOU 
\ WANT FOR APPROXIMATE FLOAT EQUALITY, TO BE USED WITH F~ IN 
\ WANT FOR APPROXIMATE FLOAT EQUALITY, TO BE USED WITH F~ IN 
\ FNEARLY=. KEEP THE SIGNS, BECAUSE F~ NEEDS THEM. 
\ FNEARLY=. KEEP THE SIGNS, BECAUSE F~ NEEDS THEM. 
FVARIABLE FSENSITIVITY DECIMAL 1E12 HEX FSENSITIVITY F! 
FVARIABLE RELNEAR DECIMAL 1E12 HEX RELNEAR F! 
: RELNEAR FSENSITIVITY ; 

FVARIABLE ABSNEAR DECIMAL 0E HEX ABSNEAR F! 
FVARIABLE ABSNEAR DECIMAL 0E HEX ABSNEAR F! 


\ WHEN EXACT? IS TRUE, }F USES FEXACTLY=, OTHERWISE FNEARLY=. 
\ WHEN EXACT? IS TRUE, }F USES FEXACTLY=, OTHERWISE FNEARLY=. 
Line 194 HASFLOATINGSTACK [IF]

Line 192 HASFLOATINGSTACK [IF]



: F...}T (  ) 
: F...}T (  ) 
FDEPTH STARTFDEPTH @ = 0= IF 
FDEPTH STARTFDEPTH @ = 0= IF 
S" WRONG NUMBER OF FP RESULTS" ERROR 
S" NUMBER OF FLOAT RESULTS BEFORE AND AFTER '>' DOES NOT MATCH: " ERROR 
THEN 
THEN 
FCURSOR @ ACTUALFDEPTH @ <> IF 
FCURSOR @ STARTFDEPTH @ + ACTUALFDEPTH @ <> IF 
S" WRONG NUMBER OF FP RESULTS" ERROR 
S" NUMBER OF FLOAT RESULTS BEFORE '>' DOES NOT MATCH ...}T SPRECIFICATION: " ERROR 
THEN ; 
THEN ; 


: FTESTER ( R  ) 
: FTESTER ( R  ) 
FDEPTH 0= ACTUALFDEPTH @ FCURSOR @ 1+ < OR IF 
FDEPTH 0= ACTUALFDEPTH @ FCURSOR @ STARTFDEPTH @ + 1+ < OR IF 
S" WRONG NUMBER OF FP RESULTS: " ERROR EXIT 
S" NUMBER OF FLOAT RESULTS AFTER '>' BELOW ...}T SPECIFICATION: " ERROR EXIT 
THEN 
THEN 
ACTUALFRESULTS FCURSOR @ FLOATS + F@ FCONF= 0= IF 
ACTUALFRESULTS FCURSOR @ FLOATS + F@ FCONF= 0= IF 
S" INCORRECT FP RESULT: " ERROR 
S" INCORRECT FP RESULT: " ERROR 
Line 224 HASFLOATINGSTACK [IF]

Line 222 HASFLOATINGSTACK [IF]

COMPUTECELLSPERFP CONSTANT CELLSPERFP 
COMPUTECELLSPERFP CONSTANT CELLSPERFP 


: FTESTER ( R  ) 
: FTESTER ( R  ) 
DEPTH CELLSPERFP < ACTUALDEPTH @ XCURSOR @ CELLSPERFP + < OR IF 
DEPTH CELLSPERFP < ACTUALDEPTH @ XCURSOR @ STARTDEPTH @ + CELLSPERFP + < OR IF 
S" WRONG NUMBER OF RESULTS: " ERROR EXIT 
S" NUMBER OF RESULTS AFTER '>' BELOW ...}T SPECIFICATION: " ERROR EXIT 
THEN 
THEN 
ACTUALRESULTS XCURSOR @ CELLS + F@ FCONF= 0= IF 
ACTUALRESULTS XCURSOR @ CELLS + F@ FCONF= 0= IF 
S" INCORRECT FP RESULT: " ERROR 
S" INCORRECT FP RESULT: " ERROR 
Line 276 HASFLOATINGSTACK [IF]

Line 274 HASFLOATINGSTACK [IF]



: ...}T (  ) 
: ...}T (  ) 
DEPTH STARTDEPTH @ = 0= IF 
DEPTH STARTDEPTH @ = 0= IF 
S" WRONG NUMBER OF RESULTS" ERROR 
S" NUMBER OF CELL RESULTS BEFORE AND AFTER '>' DOES NOT MATCH: " ERROR 
THEN 
THEN 
XCURSOR @ ACTUALDEPTH @ <> IF 
XCURSOR @ STARTDEPTH @ + ACTUALDEPTH @ <> IF 
S" WRONG NUMBER OF RESULTS" ERROR 
S" NUMBER OF CELL RESULTS BEFORE '>' DOES NOT MATCH ...}T SPECIFICATION: " ERROR 
THEN 
THEN 
F...}T ; 
F...}T ; 


: XTESTER ( X  ) 
: XTESTER ( X  ) 
DEPTH 0= ACTUALDEPTH @ XCURSOR @ 1+ < OR IF 
DEPTH 0= ACTUALDEPTH @ XCURSOR @ STARTDEPTH @ + 1+ < OR IF 
S" WRONG NUMBER OF RESULTS: " ERROR EXIT 
S" NUMBER OF CELL RESULTS AFTER '>' BELOW ...}T SPECIFICATION: " ERROR EXIT 
THEN 
THEN 
ACTUALRESULTS XCURSOR @ CELLS + @ <> IF 
ACTUALRESULTS XCURSOR @ CELLS + @ <> IF 
S" INCORRECT CELL RESULT: " ERROR 
S" INCORRECT CELL RESULT: " ERROR 
Line 329 HASFLOATINGSTACK [IF]

Line 327 HASFLOATINGSTACK [IF]

ELSE >IN ! DROP 
ELSE >IN ! DROP 
THEN ; 
THEN ; 


BASE ! 




BASE ! 