Re: [cc65] IEEE vs nonstandard floats

Date view Thread view Subject view

From: Spiro Trikaliotis (trik-news_at_gmx.de)
Date: 2003-03-10 10:21:27


Hello,    

David Holz wrote:

> What I meant is if there's a good 6502 FP library available that doesn't use
> exactly the IEEE binary representation.  For instance, my math lib that I've
> been messing around with for some time has the exponent as the number of
> bytes (instead of bits) to shift, and I normalize the highest mantissa byte
> to non-zero instead of having the implied "1" hanging off the end.  Saves a
> load of bit-shifting, but I add another byte onto the mantissa to maintain
> precision.  Plus, I haven't finished it so it's as of yet unproven, but I
> think it's got good potential as a different, faster way of doing FP on the
> 6502.

Yes, it is faster, but it is not binary FP anymore, this is hexadecimal FP.
And this has some severe disadvantages which I don't remember anymore. For 
those interested, have a look at Donald E. Knuth: TAOCP, Vol. 2: "Seminumerical 
Algorithms".


> > The C standard does not require fp math functions to raise a signal on an
> > error condition. But it requires that the a math function returns an
> > implementation defined value, so these error conditions have to be
> > detected
> > and handled in some way.
> 
> Right, so SIGFPE is Posix or somesuch, but you can implement any error
> mechanism you want (well, besides crashing ;) ) and still be C compliant?

yes, an error mechanism could even be "doing nothing".

Spiro.

----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo_at_musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.


Date view Thread view Subject view

This archive was generated by hypermail 2.1.3 : 2003-03-10 10:19:20 CET