RE: [cc65] IEEE vs nonstandard floats - math.h???

Date view Thread view Subject view

From: Greg Long (cc65_at_maneuveringspeed.com)
Date: 2003-03-10 03:15:51


There is a math.h available for CC65?

-----Original Message-----
From: owner-cc65_at_musoftware.de [mailto:owner-cc65_at_musoftware.de] On
Behalf Of David Holz
Sent: Sunday, March 09, 2003 4:59 PM
To: cc65_at_musoftware.de
Subject: Re: [cc65] IEEE vs nonstandard floats


From: "Ullrich von Bassewitz" <uz_at_musoftware.de>
> If you can prove in advance that a specific custom format is 
> significantly faster than the IEEE format, I'm open for this 
> suggestion. But I have to
admit
> that I doubt this is the case.

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.

> Here's another one: The standard specifies explicitly how the 
> different situations should be handled, so it is easy to diagnose if 
> there are
problems
> with the implementation, and a user knows exactly what he can expect.

If those situations are met, but the binary representation isn't exactly
IEEE, it should still work, right?

> 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?

--
White Flame (aka David Holz)
http://www.white-flame.com/


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

----------------------------------------------------------------------
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 03:17:01 CET