POV-Ray : Newsgroups : povray.newusers : (X <= D) different than ((X<D) | (X=D)) ? : (X <= D) different than ((X<D) | (X=D)) ? Server Time
28 Jul 2024 18:22:45 EDT (-0400)
  (X <= D) different than ((X<D) | (X=D)) ?  
From: Jarek Cora
Date: 22 Apr 2000 06:10:02
Message: <39017a7a@news.povray.org>
Hi all,
Could someone please explain the following behavior of POV-Ray 3.1g:
Let's consider a simple while loop:

#local D = 2;
#local X = -D;
#while ((X < D) | (X = D))
   #local X = X + 0.1;
#end
#debug concat("X = ",str(X,0,-1),"\n")

It produces the result X=2.10000, just as I expected.
However when I change the "while" condition to:

#while (X <= D)

the result is: X = 2.000

Why is that? I would expect that (X <= D) and ((X<D) | (X=D)) are
equivalent.

-- Jarek


Post a reply to this message

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