POV-Ray : Newsgroups : povray.general : feature request (regarding &,|) : Re: feature request (regarding &,|) Server Time
8 Aug 2024 16:19:16 EDT (-0400)
  Re: feature request (regarding &,|)  
From: Geoff Wedig
Date: 17 Nov 2000 08:13:06
Message: <3a152ee2@news.povray.org>


> No, he wants the behavior the C compiler has when evaluating:

>  if ((divisor !=0)&&(amount/divisor ...

> That is: if the divisor is 0, the division is not even performed
> because the left part of the '&&' is false.

> Sincerely, I'm against this idea for POV.
> (it's ok in C).


Oh, why?  Why should POV do extra work when the result is going to be false
already?  The reason it's done in C is to avoid that extra work.  Why would
this be a bad thing?  The only case I can think of is if there are side
effects to the second half of the equation (it calls a macro that creates an
object and returns a value), but that's so rarely necessary, plus needlessly
confusing (try figuring out code that has such side effects six months later
or which you didn't write) that it's not something that we really need.

Geoff


Post a reply to this message

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