POV-Ray : Newsgroups : povray.general : Blender Vs PovRay : Re: Blender Vs PovRay Server Time
31 Oct 2024 21:29:58 EDT (-0400)
  Re: Blender Vs PovRay  
From: Nicolas Alvarez
Date: 24 Oct 2008 22:29:52
Message: <490284a0@news.povray.org>
Nicolas Alvarez wrote:
> The problem with doing #declare V=V+1/100; is that it might not reach
> 1.0000 exactly at the end of the loop (because of floating point
> inaccuracies), so it might run one time too many.

Or even if it runs runs the correct number of times, it may have slightly
off values. And errors would *accumulate*.

Tested in Python:
>>> x = 0;
>>> for i in range(0,100):
...     x += 1.0/100;
... 
>>> print x;
1.0000000000000007
>>>


Post a reply to this message

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