POV-Ray : Newsgroups : povray.bugreports : Unexpected select () results in both 3 and 4 arguments versions : Re: Unexpected select () results in both 3 and 4 arguments versions Server Time
10 May 2024 00:48:10 EDT (-0400)
  Re: Unexpected select () results in both 3 and 4 arguments versions  
From: Tor Olav Kristensen
Date: 29 Dec 2023 20:35:00
Message: <web.658f734c5832731ec342de0989db30a9@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> So, I did some more testing, wrote a simple, standalone sample scene, and found
> yet another curious set of circumstances.
>
> And it looks like probably what's happening is another case of floating point
> math error, similar to what I experienced way back when trying to use fractional
> loop iterators.
>...

But, but, but - you are using a "fractional loop iterator" also here.
You are incrementing by a number; 0.05 = 5/100, that's not possible to write
as a binary number with a finite length.

0.05 =
0*10^0+0*10^-1+5*10^-2 =
0*2^0+0*2^-1+0*2^-2+0*2^-3+0*2^-4+1*2^-5+1*2^-6*+0*2^-7+0*2^-8+1*2^-9+1*2^-10+...

Try to use this step length instead:

#declare Step = 0.0498046875; // = 1/2^-5 + 2^-6 + 2^-9 + 2^-10

--
Tor Olav
http://subcube.com
https://github.com/t-o-k


Post a reply to this message

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