POV-Ray : Newsgroups : povray.bugreports : Clock Bug? : Clock Bug? Server Time
22 Jun 2024 22:59:56 EDT (-0400)
  Clock Bug?  
From: Gordon
Date: 18 Feb 1999 00:09:52
Message: <36cba0a0.0@news.povray.org>
Hi All,

I got this the other day and after bashing on my code for a couple of hours
found that it was what appears to be a POVRay bug.

I have a file that uses the clock value for animation. I set the animation
to use 10 frames. I multiply clock by 4 for my animation. I then take
modulus 1.0 to get the fractional part of the number only. The problem is
that at frame 5 the value is 1.0 (ie Y=mod(clock*4,1.0); results in Y=1.0).
Now when I did maths, mod(x,1.0) can NEVER be equal to 1.0, what gives?

After some investigation, I found that the value for the clock at frame 5 is
around 2.00000000000000001! This still doesn't explain how the mod()
function gives me 1.0 as an answer though, so perhaps there are two bugs
here, one in the calculation of clock values, and one in the mod function.

Has anyone else seen this? Does anyone have a way to work around this error
that will work regarless of the number of frames? ( If I use an odd number
of frames, the problem goes away )

Regards,
Gordon
<gor### [at] hotmailcom>


Post a reply to this message

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