POV-Ray : Newsgroups : povray.general : cos(pi*3/2) results -0.000 : Re: cos(pi*3/2) results -0.000 Server Time
4 Aug 2024 22:17:02 EDT (-0400)
  Re: cos(pi*3/2) results -0.000  
From: Thorsten Froehlich
Date: 24 Jan 2003 16:44:00
Message: <3e31b3a0$1@news.povray.org>
In article <3e31a57f@news.povray.org> , Jellby <jel### [at] M-yahoocom>  
wrote:

>
> Unfortunately, POV-Ray is not perfect and there are (as in most computer
> programs) floatin point inaccuracies and rounding errors. That means the
> result is not *exactly* 0, but slightly lower, and you see -0.000. This is
> normal and expected behaviour, if you are testing against 0 you should in
> turn test that abs(y) < tiny_number.

It isn't even a rounding error.  PI can never be represented exactly in any
evaluation (assuming certain properties of PI are indeed true).  So while
symbolically the result 0.0 is correct, numerically that cannot be reached.

    Thorsten

____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

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