POV-Ray : Newsgroups : povray.general : Precision of large objects : Re: Precision of large objects Server Time
30 Jul 2024 12:30:14 EDT (-0400)
  Re: Precision of large objects  
From: clipka
Date: 1 Sep 2009 14:19:42
Message: <4a9d65be$1@news.povray.org>
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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.