POV-Ray : Newsgroups : povray.newusers : (X <= D) different than ((X<D) | (X=D)) ? : Re: (X <= D) different than ((X<D) | (X=D)) ? Server Time
28 Jul 2024 20:33:32 EDT (-0400)
  Re: (X <= D) different than ((X<D) | (X=D)) ?  
From: Bob Hughes
Date: 22 Apr 2000 08:09:27
Message: <39019677@news.povray.org>
Not that I really know but <= might be considered as "less than AND equal to" whereas
the
OR is taken to be the case in the ((X < D) | (X = D)), so <= won't let it also be
equivalent although the | does.

Bob

"Jarek Cora" <jco### [at] pocztafm> wrote in message news: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.