Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!lll-crg!lll-lcc!qantel!hplabs!tektronix!uw-beaver!fluke!ssc-vax!uvicctr!mesans From: mesans@uvicctr.UUCP (mesans) Newsgroups: net.lang.c Subject: Re: Boolean Operators Slighted in C Message-ID: <167@uvicctr.UUCP> Date: Tue, 13-May-86 23:52:38 EDT Article-I.D.: uvicctr.167 Posted: Tue May 13 23:52:38 1986 Date-Received: Tue, 20-May-86 06:17:23 EDT References: <838@ihwpt.UUCP> <778@bentley.UUCP> <210@sdchema.sdchem.UUCP> <1305@umcp-cs.UUCP> Reply-To: mesans@uvicctr.UUCP () Organization: University of Victoria, Victoria B.C. Canada Lines: 17 >>Not quite the same. >> 3 ^^ 4 >>would evaluate as 0, >> 3 != 4 >>evaluates as 1. > >If the left and right hand sides are both already boolean, `!=' works; >but the following macro always works: > > /* logical exclusive or */ > #define lxor(a, b) (((a) != 0) != ((b) != 0)) Which is equivalent to : !a != !b which I think you will agree is much simpler, and easyer to understand (at least I think so). S. John Banner