|
![](/i/fill.gif) |
Warp schrieb:
> Of course it doesn't affect the precision of floating point computations.
> Double-precision floating point numbers will always have 53 bits of
> precision. that doesn't change.
>
> However, when multiplying two 15-digit numbers, the result will have
> 30 significant digits of information, and from those the 15 least significant
> will be lost. Thus the result will not be exact.
Well, it will be just about as exact as the input numbers:
> 0.123456789012345 * 0.123456789012345 =
> 0.01524157875323866912056239902
That's actually more like:
( 0.123456789012345e0 +/- 1.0e-15 )
* ( 0.123456789012345e0 +/- 1.0e-15 )
= 0.01524157875323866912056239902e0
+/- 0.123456789012345e-15
+/- 0.123456789012345e-15
+ 1.0e-30
= 0.1524157875323866912056239902e-1
+/- 2.46913578024690e-16
+ 1.0e-30
which again fits neatly within the original relative precision. No harm
done by storing it into a double-precision floating point again (the
number format even provides a slightly higher precision than the
multiplication result could ever have, given that the operands were
double-precision floats as well).
Post a reply to this message
|
![](/i/fill.gif) |