|
|
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
--
_ | Peter J. Holzer |
|_|_) | Sysadmin WSR | In case of emergency break laws of physics.
| | | hjp### [at] hjpat |
__/ | http://www.hjp.at/ | -- Stephen Baxter
Post a reply to this message
|
|