12.25Forth Scientific Library. 4tH 4tH Forth compiler
Mainos
Mainos
CHAPTER 12. STANDARD LIBRARIES 199
F
ILE fp0.4th
fp1.4th
fp2.4th
fp3.4th
fp4.4th
Zen
Zen
Zen
ANS
ANS
Family FP stack ANS-F
ORTH
COMPLIANCE
S
IZE
P
RECISION
P
ORTING
TO
ANS-
F
ORTH
Low
Low
No
Yes
P
ORTING
ANS-
F
ORTH
No
Limited
Unified
Unified
Unified
Separate
Separate
None
ANS 1994 compatible
ANS 1994 compilant
ANS 200x compatible
ANS 200x compliant
Small
Small
Medium
Medium
Large
Low
High
High
Table 12.11: Floating point configurations
Yes
Yes
Yes
Yes
Limited
Yes
[DEFINED] ZenFP [IF] .( Zen float is loaded) cr [THEN]
[UNDEFINED] ZenFP [IF] .( ANS float is loaded) cr [THEN]
If you enter the realm of full fledged floating point numbers, you may find it very hard to resolve all dependencies. Well, it is not so hard as you think as long as you apply the following rule of the tumb. Before including any other floating point library file include this one: include lib/fp3.4th
\ now you may include other library files
If you don’t mind the size or the speed but do require full ANS Forth compliance, begin your program like this: include lib/fp4.4th
\ now you may include other library files
You will see that this resolves most of your dependency problems
24
. Bottom line: if you don’t need floating point numbers, avoid them and apply other techniques. But sometimes it cannot be avoided and I guess you’ll agree with me that it’s good it’s there.
12.25
Forth Scientific Library
4tH includes serveral library members of the Forth Scientific Library. The FSL contains several very complex and highly specialized mathematical words. Some of these words have been adapted to work with 4tH. All you have to do is to include fsl-util.4th after you’ve included ansfloat.4th, ansfpio.4th and preferably also fpconst.4th.
It doesn’t work with zenfloat.4th.
include lib/ansfloat.4th
include lib/ansfpio.4th
include lib/fsl-util.4th
24
If not, take a look at chapter 23.2.
Lataa
Mainos