POV-Ray : Newsgroups : povray.unofficial.patches : Why & has higher precedence than + or - in isosurface functions? : Re: Why & has higher precedence than + or - in isosurface functions? Server Time
2 Sep 2024 08:18:13 EDT (-0400)
  Re: Why & has higher precedence than + or - in isosurface functions?  
From: Warp
Date: 2 Aug 2000 11:12:16
Message: <39883a4f@news.povray.org>
pk <thi### [at] videotronca> wrote:
: You've never made any programmation before, have you?

  I have been programming for about 10 years.

: In most programming languages, they assign a value to TRUE, and another
: to FALSE(in the case above, FALSE=0, and TRUE=NOT(FALSE) )
: In other languages, fe, C(for which i dont't really remember the
: standard), it's something like TRUE = -1 (binary 11111111) and FALSE
: would be 0(binary 00000000)...

  Nope. In C a true value is 1 (for example the result of the sentence a==b
is 1 if a is equal to b, else 0). When testing a conditional, any value
other than 0 is considered true, and 0 is considered false.

  In this context (0.5 AND -2.8) would be true because none of them is 0.
This, however, has no mathematical meaning whatsoever. It hasn't any meaning
in isosurface functions either (what would a 'true' or 'false' value mean
in a function, may I ask?).

: And, for your trivia, it depends: most languages will do logical
: operations bit by bit, but i suppose that others have a Boolean
: type(Java, fe i think), and will undercast it before doing the
: LOGICAL_AND

  The point is that the & operator in isosurface functions is not even close
to the logical AND-operator of programming languages.

: And, yes, doing Logical operations bit by bit can be useful, and anyway,
: you can just add a comparison operator before doing the boolean
: operation... 

  Firstly, there's no bitwise AND-operator anywhere in the povray language,
and secondly, the &-operator in isosurface functions is neither a logical
nor a bitwise AND-operator.
  It would make no sense in having a logical operator in a function anyways.
Which function is 'true' or 'false'? How do you draw the function { true } ?
  (No, I'm not talking about the povray keyword 'true' here.)

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):_;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

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