|
![](/i/fill.gif) |
Hi all,
POV-Ray for Windows version 3.6.1a.icl8.win32
Windows XP sp2
I believe I have discovered a bug with #while loop processing when
comparing conditional values that are less than one. When checking
the "Loop" variable for less than one, the #while block is still
processed when the value one is reached.
The bug can be best explained and reproduced with the following code.
>>> snip >>>
// demonstration of possible bug in POV-Ray for Windows
// Version 3.6.1a.icl8.win32
camera {
location <0, 0.5, -2>
look_at <0, 0.5, 0>
}
// bug - should not enter while block when "Loop" = 1
#declare Loop = 0.0;
#while ( Loop < 1 )
sphere {
<-0.1, Loop, 0>, 0.05
pigment { rgb <1, 0, 0> }
finish { ambient 1 }
}
#declare Loop = Loop + 0.1;
#end
// example for comparison
#declare Loop = 0.0;
#while ( Loop < 0.99 )
sphere {
<0.1, Loop, 0>, 0.05
pigment { rgb <0, 1, 0> }
finish { ambient 1 }
}
#declare Loop = Loop + 0.1;
#end
>>> snip >>>
The #while loop that produces the red spheres is executed for the
"Loop" value of one when it should stop at 0.90, similar to "Loop <=
1". The #while loop that produces the green spheres is there for
comparison.
The #while loop processes properly if the comparison is changed to a
higher value, such as "Loop < 10". It also fails for lower values,
such as "Loop < 0.90", so the problem seems to be for values of one or
less.
Unless I'm really missing something obvious, this seems to be a bug.
Thanks to everyone involved for such a great product!
Best Regards,
Kyle Johnson
Post a reply to this message
|
![](/i/fill.gif) |