Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!unixhub!stanford.edu!neon.Stanford.EDU!Gang-of-Four!dkeisen From: dkeisen@Gang-of-Four.Stanford.EDU (Dave Eisen) Newsgroups: comp.lang.c Subject: Re: The nonexistent operator (along = v. == lines) Keywords: xor Message-ID: <1991Apr3.203748.3226@neon.Stanford.EDU> Date: 3 Apr 91 20:37:48 GMT References: <156@revcan.UUCP> <157@revcan.UUCP> Sender: news@neon.Stanford.EDU (USENET News System) Organization: Sequoia Peripherals Lines: 19 In article <157@revcan.UUCP> darren@revcan.UUCP (Darren Morbey) writes: >What I did require was an operator, macro, or function that treated >its operands as "zero" or "non-zero" as && and || do rather than >the bitwise & | ^. I also would like some guarantee that both >operands were evaluated *once* *and* *only* *once* (O&OO). Based >on that, I do recognize that in #define XOR(a,b) (!!(a) ^ !!(b)) does what you want. -- Dave Eisen 1101 San Antonio Rd. Suite 102 Mountain View, CA 94043 (415) 967-5644 dkeisen@Gang-of-Four.Stanford.EDU (for now)