|
|
"Peter J. Holzer" <hjp### [at] hjpat> wrote in message
news:slr### [at] tealhhjpat...
> On 2002-01-30 15:58, Warp <war### [at] tagpovrayorg> wrote:
> > Tom Melly <tom### [at] tomandlucouk> wrote:
> > : Just out of curiousity, why does this surprise you?
> >
> > I knew that doubles are inaccurate, but it surprised me that they are
*that*
> > inaccurate. The inaccuracy is "only" in the 18th decimal.
>
> "That" inaccurate? 18 decimal places is enough to locate anything
> between here and Alpha Centauri with an inaccuracy of less than two
> inches.
>
> > On the other hand, 18 decimals starts to sound like the maximum number
of
> > digits (when converted to decimal) that the base of a double can hold...
>
> More like 16, actually. An IEEE-754 double precision floating point
> number is 64 bits long: 1 for the sign, 11 for the exponent, which
> leaves 52 bits for the exponent. So the precision is log(2^52) = 15.6
> decimal places.
>
> hp
I thought they were 80 bits - at least, on x87 chips they are (which doesn't
mean anything about the standard!). Floats are 32bits (with an additional 8
bit mantissa), and doubles are 64 bits (with an additional 16 bit mantissa),
making them 40 and 80 bits, respectively.
...Chambers
Post a reply to this message
|
|