Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site brl-tgr.ARPA Path: utzoo!linus!philabs!cmcl2!seismo!brl-tgr!gwyn From: gwyn@brl-tgr.ARPA (Doug Gwyn ) Newsgroups: net.lang.c Subject: Re: Standard extensions (logical exclusive or) Message-ID: <5712@brl-tgr.ARPA> Date: Sun, 11-Nov-84 15:15:50 EST Article-I.D.: brl-tgr.5712 Posted: Sun Nov 11 15:15:50 1984 Date-Received: Tue, 13-Nov-84 01:17:35 EST References: <374@petsd.UUCP>, <3081@alice.UUCP> <376@petsd.UUCP> Organization: Ballistic Research Lab Lines: 20 > > a^^b > > > >would be equivalent to > > > > a? (b?0:1): (b?1:0) > > Another expression for a^^b is (a==0)^(b==0). > Yet another one is (a!=0)^(b!=0). To my mind, one of the sloppiest aspects of C is the omission of a true Boolean data type and the substitution of "nonzero integer" instead. The first expression given above at least has the advantage that it does not require evaluating an operand more than once nor using bitwise operators. There are a total of 16 Boolean binary operators, some of which are reducible to simpler expressions. Allowing for "conditional" operators (e.g. && ||) there are a few more possibilities. How many of these need to be in the language?