POV-Ray : Newsgroups : povray.pov4.discussion.general : I want to be rid of my stupid mistakes : Re: I want to be rid of my stupid mistakes Server Time
2 Jun 2024 09:47:47 EDT (-0400)
  Re: I want to be rid of my stupid mistakes  
From: scott
Date: 22 Jul 2009 10:06:38
Message: <4a671cee@news.povray.org>
>> Can you give an example - I don't understand how that would work (I 
>> thought
>> that the condition decided when the loop ended).
>
> #declare Limit = .8;
> #while(MyRand() < Limit)
>  doSomething();
> #end

As I already wrote to clipka when he mentioned the rand() function, as the 
result could be different each time from a macro, the infinite-loop-checker 
effectively would assume that the result was being reassigned each loop, so 
not flag it up as an infinite loop.


Post a reply to this message

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