[comp.lang.forth] Floating Point

ForthNet@willett.UUCP (ForthNet articles from GEnie) (01/20/90)

 Date: 01-17-90 (13:10)              Number: 1714 (Echo)
   To: ALL                           Refer#: NONE
 From: MARK DOWDEY                     Read: (N/A)
 Subj: VP FLOATING PT OUTPUT         Status: PUBLIC MESSAGE

 I am currently using VP software floating point (ver 1.01) with F-PC 3.5
 and I need formatted output (similar to D.R) to display results.  The
 output words available seem to be limited to F. and E.  
 F. works, but the output is of variable length.  E. is of fixed length,
 but it hangs my system when I print a zero!  ( " 0e0  e. " will crash.)
 Also, I would prefer not to display in exponential format.  ( 3.005 is
 preferable to 3.500E+00 )  Has anyone out there already invented this
 particular wheel?

 Thanks in advance,
-----
This message came from GEnie via willett through a semi-automated process.
Report problems to: 'uunet!willett!dwp' or 'willett!dwp@gateway.sei.cmu.edu'

ForthNet@willett.UUCP (ForthNet articles from GEnie) (01/21/90)

Category 10,  Topic 8
Message 28        Sat Jan 20, 1990
GARY-S                       at 14:19 EST
 From apple!milton.u.washington.edu!sphinx Sat Jan  6 20:42:11 1990
 Date: Sat, 6 Jan 90 20:38:45 -0800
 From: Jina Chan <apple!milton.u.washington.edu!sphinx>
 To: gars@well.sf.ca.us
 Subject: 8087 interface

 From: sphinx@milton.u.washington.edu 6 Jan 1990

 Thank you for your efforts. I would like to interface my Sanyo 555
 (an IBM compatible but not a clone because interrupt-10 is not all there,
 which has 8088 and 8087 chips, 256k and two 360k drives) to the 8087
 math chip.
   I am looking for versions of hardware floating point extensions and F83
 versions that run together. I have a version of F83 v. 2.1 and Polack's      
FTP-F83.arc (downloaded from Genie) that do not run together. Is F83 v.2.01,
 advertised on back cover of latest Forth Dimensions, the same as 
 F83 v. 2.1 ?
   I could not get the .exe file in F-PC to load on my machine because of
 lack of available memory (or so it claimed). How can I get F-PC to run?
   Can VP Planner Floating point for F-PC v. 1.01 (also advertised on
 back of Forth Dimensions Nov/Dec No. 4) by Jack Brown of BCFIG and 
 BC Institute of Technology be made to run with any version of F83? 
 (Which?)
   I am at the U. of Washington in Seattle, Washington state, and can
 be reached on the Internet as 
       sphinx@milton.u.washington.edu

                                             --Jina Chan

 To: gars@well.sf.ca.us apple!milton.u.washington.edu!sphinx
 Subject: Re:  8087 interface

 Jina -
   The two F83's are essentially the same. YES - It is my understanding
 VP Planner F.P. will plug to F83. Download a copy from GEnie. You might 
 also down load a copy of Martin Tracy's zenfloat.<- this is a very slick
 two screen floating point routine I have mounted on several versions of 
 Forth. 
    PLEASE remember, I am a GEnie SysOp. Do NOT hesitate to leave GEnie 
 e-mail asking for specifics. This will perhaps reduce your on-line charge
 time.
   IF your site administrator at u.washington will get the latest (16 Jan)
 maps containing u.usa.ar.1 then you can address me directly on my home
 system          gars@glsrk.uucp
   glsrk is not in any maps older than 16 Jan !
     Gary
-----
This message came from GEnie via willett through a semi-automated process.
Report problems to: 'uunet!willett!dwp' or 'willett!dwp@gateway.sei.cmu.edu'

ForthNet@willett.UUCP (ForthNet articles from GEnie) (03/01/90)

 Date: 02-28-90 (03:20)              Number: 1764 (Echo)
   To: JACK BROWN                    Refer#: NONE
 From: MARK SMILEY                     Read: NO
 Subj: VPSFLOAT BUG                  Status: PUBLIC MESSAGE

 Jack,
 VPSFLOAT doesn't understand things like 'B' , which SFLOAT and HFLOAT's
 NUMBER interpret as    ASCII B                                         
                    Mark
-----
This message came from GEnie via willett through a semi-automated process.
Report problems to: 'uunet!willett!dwp' or 'willett!dwp@gateway.sei.cmu.edu'

ForthNet@willett.pgh.pa.us (ForthNet articles from GEnie) (08/30/90)

Category 10,  Topic 8
Message 39        Wed Aug 29, 1990
R.BERKEY [Robert]            at 04:12 PDT
 
  Mitch Bradley writes:

 > Suppose that we have a function FSTKCELLS

 > FSTKCELLS  ( n -- ncells )
 >  ncells is the number of data stack items occupied
 >  by a n floating point numbers.

 > If there is a separate floating point stack, FSTKCELLS would be
 > DROP 0.  Otherwise, it might be NOOP or 2* or 4* or whatever is
 > correct, considering the relative sizes of integers and floating
 > point numbers.

 > Given this function, mixed stack operations can be portably
 > expressed as a (usually trivial) calculation involving FSTKCELLS and
 > PICK .

Of course, PICK is no longer in the required word set, and won't be available
on all systems.

My understanding is that a floating-point number represents a "plug" on the
data stack.  BASIS13 won't have a specification for the size of a floating-
point value on the data stack.  This means that floating-point values on the
data stack could have varying sizes.  Thus, with BASIS13, there is no portable
way of getting around a floating-point value on the data stack.

-----
This message came from GEnie via willett through a semi-automated process.
Report problems to: uunet!willett!dwp or dwp@willett.pgh.pa.us

ForthNet@willett.pgh.pa.us (ForthNet articles from GEnie) (09/03/90)

Category 10,  Topic 8
Message 40        Fri Aug 31, 1990
D.RUFFER [Dennis]            at 13:33 EDT
 
From Elizabeth Rather, Chair, ANS X3J14 Technical Committee:

This is addressed to those who have been commenting extensively on our work on
UseNet and related boards.

5. Finally, regarding the floating stack, the rule for writing "don't care"
code is to nest "like" data types such that you aren't shuffling.  That is,
say

    addr1 F@ addr2 F@ F+ addr3 F!

(which works fine in both versions) if you like, but not

    addr3 addr1 addr2 F@ F@ F+ F!

(or addr3 addr2 addr1 F@ ROT F@ because how do you know it's a ROLL and not n
PICK?)

If you avoid situations that involve mixed stack thrashing (which takes some
care) you may find you have more readable code.  Lee Brotzman's admittedly
sloppy practice of ignoring argument orders contributes flagrantly to the
notion that Forth is "write-only code" in my opinion.

Of course this doesn't help existing programs.  The simplest solution to avoid
rewriting is to declare an environmental dependency.  This isn't a "scarlet
letter", you know.  If you "restrict" your programs to running on 80x87 and
6888x coprocessors you still have the overwhelming bulk of the market.  The
biggest selling software packages of all time run only on DOS PC's.
-----
This message came from GEnie via willett through a semi-automated process.
Report problems to: uunet!willett!dwp or dwp@willett.pgh.pa.us

ForthNet@willett.pgh.pa.us (ForthNet articles from GEnie) (09/03/90)

Category 10,  Topic 8
Message 41        Sun Sep 02, 1990
B.RODRIGUEZ2 [Brad]          at 09:59 EDT
 
Sorry, I don't buy it.  It's easy to come up with glib rules to circumvent any
problem, but usually these rules are not practical. For example: the old rule
for writing "don't care" code with LEAVE was to use it _only_ at the end of a
do loop, e.g.

    ... DO ... ... IF LEAVE THEN LOOP ...

which works for both 79 and 83 standard, but how many people _really_ program
this way?  And I maintain that this glib rule is much easier to practice than
your proposed floating-point guideline.

I don't think you can avoid mixing data types on the stack, considering that
it is Forth's primary working area.  How many of us have managed to avoid
mixing single- and double-precision numbers on the stack?

- Brad
-----
This message came from GEnie via willett through a semi-automated process.
Report problems to: uunet!willett!dwp or dwp@willett.pgh.pa.us

ForthNet@willett.pgh.pa.us (ForthNet articles from GEnie) (12/13/90)

 Date: 12-11-90 (19:00)              Number: 498 of 498 (Echo)
   To: GARY SMITH                    Refer#: 476
 From: RAY DUNCAN                      Read: NO
 Subj: FLOATING POINT                Status: PUBLIC MESSAGE
 Conf: FORTH (58)                 Read Type: GENERAL (+)

    >Besides Harris, I believe LMI... uses a floating point
    >implementation without a floating point stack

 That's right.  Our "official" versions of software floating point and
 hardware-assisted floating point do not maintain the numbers on a
 separate stack.  We have been doing it this way for about 10 years and
 we have never found it to be a problem.

 For those people who need the last drop of performance, we have a
 separate version of our hardware floating point implementation available
 for downloading on our BBS which maintains the floating point values on
 the Intel 80x87 floating point stack and allows explicit chaining of
 calculations on the separate stack.

 NET/Mail : LMI Forth Board, Los Angeles, CA (213) 306-3530
 <<<>>>
-----
This message came from GEnie via willett through a semi-automated process.
Report problems to: dwp@willett.pgh.pa.us or uunet!willett!dwp

toma@tekgvs.LABS.TEK.COM (Tom Almy) (12/14/90)

In article <2112.UUL1.3#5129@willett.pgh.pa.us> Ray Duncan writes:
>    >Besides Harris, I believe LMI... uses a floating point
>    >implementation without a floating point stack

> That's right.  Our "official" versions of software floating point and
> hardware-assisted floating point do not maintain the numbers on a
> separate stack.

> For those people who need the last drop of performance, we have a
> separate version of our hardware floating point implementation available
> for downloading on our BBS which maintains the floating point values on
> the Intel 80x87 floating point stack and allows explicit chaining of
> calculations on the separate stack.

I wrote this version to support an "experimental" floating point version
of the Native Code Compiler. (The NCC compiles colon definitions as
CODE words or subroutines, and has been commercially available either
from LMI or myself since 1983 in versions for the Z80, 80x86 and 80386
protected mode).

The 80x87, being a stack processor, is ideal for executing Forth floating
point. In fact, native code compiled floating point calculations are
roughly as fast as direct-threaded-interpreted integer calculations (80386/7).
It hardly made sense to compile the code to move the numbers between the
stacks, which involves a data conversion in the x87, especially when most
Forth floating point primitives could compile to a single 80x87 instruction.
In order to allow native code and threaded code floating point functions to
coexist I rewrote the standard LMI package. Other than changing the bottom
level code words I only had to make one other change attributable to the
use of two rather than one stack. I feel the debate over separate stacks
is highly overrated!

The resulting floating point code compared highly favorably (sometimes
several times faster, and never slower) to the available C compilers (MS 5.0,
Borland 1.5) at the time doing matrix multiplication and other similar
operations and beat or matched these compilers in accuracy tests. While
the C compilers have gotten smarter in using the 80x87 stack, they still
don't match what can be done with native code compiled Forth. Just the
ability to multiprogram (interleave fp and integer calculations) makes for
a win.

Tom Almy
toma@tekgvs.labs.tek.com
Standard Disclaimers Apply

ForthNet@willett.pgh.pa.us (ForthNet articles from GEnie) (04/01/91)

Category 10,  Topic 8
Message 67        Sun Mar 31, 1991
ATFURMAN [Alan F.]           at 17:43 PST
 
John Wavrik writes:

 > "...And the boys you'll attract that way, you don't want."


        Are we not men?
        We are UNIX.
        Are we not men?
        U N I X.


(Found on a distant BBS long ago; apologies to DEVO.)

==========================================================================
      "This disclaimer is strictly the author's personal opinion."
-----
This message came from GEnie via willett.  You *cannot* reply to the author
using e-mail.  Please post a follow-up article, or use any instructions
the author may have included (USMail addresses, telephone #, etc.).
Report problems to: dwp@willett.pgh.pa.us _or_ uunet!willett!dwp

ForthNet@willett.pgh.pa.us (ForthNet articles from GEnie) (06/28/91)

 Date: 06-26-91 (08:23)              Number: 263 of 263 (Echo)
   To: GARY SMITH                    Refer#: 251
 From: JACK WOEHR                      Read: NO
 Subj: FLOATING POINT                Status: PUBLIC MESSAGE
 Conf: FORTH (58)                 Read Type: GENERAL (+)

 -> From: tonl@hpuamsa.neth.hp.com (Ton 't Lam CRC) Subject: Emulating
 -> floating point in FORTH. Message-ID: <27460001@hpuamsa.neth.hp.com>
 -> Date: 21 Jun 91 11:58:01 GMT Organization: HP-Sales Office-The
 -> Netherlands
 -> An acquantance of mine asks for FORTH sources emulating floating
 -> point in a proper way, i.e. up to 12 digits. He is thinking about LN,
 -> LOG, SIN, et cetera.
 -> He now has some pure FORTH environment.
 -> I know some books exists against this subject.

         Mountain View Press ( phone USA California 415-747-0760) has
 a floating point package in software for their 79-STANDARD MVP-Forth.

                 =jax=

 NET/Mail : RCFB Golden, CO (303) 278-0364 VESTA & Denver FIG for Forth!
 <<<>>>
-----
This message came from GEnie via willett.  You *cannot* reply to the author
using e-mail.  Please post a follow-up article, or use any instructions
the author may have included (USMail addresses, telephone #, etc.).
Report problems to: dwp@willett.pgh.pa.us _or_ uunet!willett!dwp