Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site petsd.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxj!houxm!vax135!petsd!joe From: joe@petsd.UUCP (Joe Orost) Newsgroups: net.lang.c Subject: Re: Standard extensions (logical exclusive or) Message-ID: <376@petsd.UUCP> Date: Thu, 8-Nov-84 09:20:14 EST Article-I.D.: petsd.376 Posted: Thu Nov 8 09:20:14 1984 Date-Received: Fri, 9-Nov-84 08:37:22 EST References: <374@petsd.UUCP>, <3081@alice.UUCP> Organization: Perkin-Elmer DSG, Tinton Falls, N.J. Lines: 39 <> >Joseph Orost suggests a new operator ^^ such that > > a^^b > >would be equivalent to > > a? (b?0:1): (b?1:0) > >What is wrong with writing > > a!=b > >for this purpose? Sorry, this is not the same. Take, for instance, a=3 and b=4. a^b = 7 a!=b = 1 a^^b = 0 Next take a=3 and b=0: a^b = 3 a!=b = 1 a^^b = 1 Another expression for a^^b is (a==0)^(b==0). Yet another one is (a!=0)^(b!=0). And yes, you have to evaluate both a and b no matter what. regards, joe -- Full-Name: Joseph M. Orost UUCP: ..!{decvax,ucbvax,ihnp4}!vax135!petsd!joe US Mail: MS 313; Perkin-Elmer; 106 Apple St; Tinton Falls, NJ 07724 Phone: (201) 870-5844