[Coco] Re: GCC: DFLOAT / DIRECT_PAGE
jdaggett at gate.net
jdaggett at gate.net
Sun Nov 16 09:26:00 EST 2003
What is used in Color Basic is an adoption of IEEE Standard with an added
"sub" byte to get 9 decimal digit precision. What it ends up with is 31 bits in the
mantissa. 9 decimal digit precision is standard calculator display! The RS Basic
had to do this to use a 6th term in the Taylor Series to calculate the trancendetal
functions with 9 digit precision. The sixth coefficient of the Taylor Series for the
Sine function is one over eleven factorial. That is to small a number to be
represented in standard IEEE single precision floating point.
There have been as many schemes to do floating point. The IEEE Standard did
not become a standard until the mid to late 80's. All still have basically the same
format. A sign, and exponent and a mantissa. How many bytes used to
represent them and to what precision you want is ultimately the end users
decision and the computing power available.
james
On 15 Nov 2003 at 11:36, Theodore A. Evans wrote:
> 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 = ?
>
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> http://five.pairlist.net/mailman/listinfo/coco
More information about the Coco
mailing list