Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxn!mhuxm!mhuxf!mhuxi!mhuhk!mhuxt!houxm!ihnp4!ltuxa!ttrdc!levy From: levy@ttrdc.UUCP (Daniel R. Levy) Newsgroups: net.lang.c Subject: Re: Boolean Operators Slighted in C Message-ID: <880@ttrdc.UUCP> Date: Sun, 11-May-86 18:27:43 EDT Article-I.D.: ttrdc.880 Posted: Sun May 11 18:27:43 1986 Date-Received: Tue, 13-May-86 03:27:01 EDT References: <838@ihwpt.UUCP> <778@bentley.UUCP> <210@sdchema.sdchem.UUCP> <732@steinmetz.UUCP> Organization: AT&T, Computer Systems Division, Skokie, IL Lines: 22 In article <732@steinmetz.UUCP>, davidsen@steinmetz.UUCP (Davidsen) writes: >XOR can be defined as an (ugly) macro, I believe. > >#define XOR(a,b) (((a) != 0) != ((b) != 0) >/* or if you like small better than readable */ >#define XOR(a,b) (!!(a) != !!(b)) >-- > -bill davidsen or even #define XOR(a,b) (!(a) != !(b)) since XOR(not-a,not-b) == XOR(a,b) -- ------------------------------- Disclaimer: The views contained herein are | dan levy | yvel nad | my own and are not at all those of my em- | an engihacker @ | ployer or the administrator of any computer | at&t computer systems division | upon which I may hack. | skokie, illinois | -------------------------------- Path: ..!{akgua,homxb,ihnp4,ltuxa,mvuxa, vax135}!ttrdc!levy