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:26 EDT (-0400)
  Re: Why & has higher precedence than + or - in isosurface functions?  
From: Thorsten Froehlich
Date: 2 Aug 2000 14:32:53
Message: <39886955@news.povray.org>
In article <39884355.DCB5F320@buckosoft.com> , Dick Balaska 
<dic### [at] buckosoftcom>  wrote:

>>   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.
>
> Your definition is wrong, but your example is correct. :)
>
> False is 0.  True is not false.
> 1 is a true value, as is 2, as is -1.
>
> I have seen #define TRUE 1
> I have also seen #define TRUE ~FALSE

In C++ he would be nearly right :-)   Except that there is no definition of
the internal representation of the type "bool" which is left to the
compiler/platform (i.e. some RISC platforms like PowerPC have several
condition-code registers and instructions to work with them).

Only conversions from and to "bool" are defined in C++, and in case of the
conversion of bool to anything, true will be "1".


     Thorsten


____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

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