[Coco] Re: GCC: DFLOAT / DIRECT_PAGE

Theodore A. Evans alxevans at concentric.net
Sat Nov 15 16:38:00 EST 2003


I did some research on the ANSI C standard as regards floating point.
You can use any integer radix for the exponent (typically either 2 or
10).  You can support rounding by any method that you see fit to.  A
float needs at least 6 decimal digits of precision (i.e. 20 bits), and
both a double and a long double require at least 10 decimal digits of
precision (i.e. 34 bits).  Your radix needs to cover at a minimum the
range 10^-37 to 10^37, so for a decimal radix you need 7 bits and for
a binary radix 8 bits.  Concievably a float can be stored in 28 bits
and both a double and a long double in 42 bits.

The numbers used in Color BASIC are sufficient for floats, but
(barely) fall short for double and long double.

-- 
Why did I ever start this, anyway?
Theodore (Alex) Evans            | alxevans at concentric.net
94-1071 Kepakepa St. Unit #C-1   | http://www.concentric.net/~alxevans
Waipahu, HI 96797                | ICQ 78089262
x                                | (808) 676-0123         2B v ~2B = ?




More information about the Coco mailing list