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 06:18:32 EDT (-0400)
  Re: Why & has higher precedence than + or - in isosurface functions?  
From: Warp
Date: 4 Aug 2000 05:59:05
Message: <398a93e8@news.povray.org>
Dick Balaska <dic### [at] buckosoftcom> wrote:
: I have also seen #define TRUE ~FALSE

  This is horrible. It doesn't work!

  Suppose we have:

#define FALSE 0
#define TRUE ~FALSE

  Then TRUE will be -1 (ie. all bits set).

  Now suppose we want to add a "boolean" type:

typedef int BOOL;

  This will NOT work as it should:

int x=2, y=2;
BOOL b;

b = (x==y);

if(b == TRUE)
  puts("Equal");
else
  puts("Different");


  This will print "Different" although x and y are equal.

-- 
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.