[comp.lang.forth] Floating point in Forth

wmb@MITCH.ENG.SUN.COM (Mitch Bradley) (03/22/91)

> >who  actually think that floating point arithmetic has been  unavail-
> >able  to Forth programmers for these many years. During the  past  11
> >years  I have had access to floating point packages on various  Forth
> >systems  -- and have not had to write one for myself.
>
>         Right on, Dr. John! Even our eentsy Vesta embedded control oriented
> CPUs have floating point and transcendentals in ROM Forth ... Floating point
> (which mostly I can live without) is here to stay in Forth, not because the
> language prevents it or supports it, but because it ain't that big a deal
> to implement in Forth.

1) Floating point is not specified in any existing Forth standards document.

2) Forth floating point wordsets are not described in the most popular
   Forth textbooks.  Instead, these books go to some length to tell you
   how to get along without floating point.

3) Until F-PC, the most widely-used and influential PD Forth systems
   (FIG-Forth and F83) did not come with floating point, nor was a
   floating point extension package for these systems readily available.
   (The notion of "readily available" includes sufficient publicity so
   that it is easy for a novice to locate it.)

Therefore, I claim that from the valid viewpoint of many people, Forth
itself does not have floating point.

Many Forth systems do indeed have floating point, but the reason has
nothing to do with whether or not floating point is a "big deal to
implement".  The reason is because *the market demands it*.

As to whether or not it is a big deal to implement in Forth, I would
venture to guess that very few readers of this newsgroup could implement
a complete, commercial quality floating point package in Forth in one
week.  My standards for commercial quality include IEEE double precision
format with proper rounding, good accuracy on the complete set of common
transcendentals, and reasonable speed (say within a factor of 4 of what
you get from C).  Also, it should be able to run with or without a floating
point coprocessor, depending on whether or not one is present.

You may wish to quibble with one or more of these criteria.  By and
large, these are the market requirements that are used to judge
floating point implementations for other languages.  Implementations
that do not measure up are driven out of business by higher-quality
implementations.

Mitch