Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!brutus.cs.uiuc.edu!apple!agate!ucbvax!hplabs!hpfcso!hppad!bazza From: bazza@hppad.HP.COM (Carlos Bazzarella) Newsgroups: comp.lang.c Subject: Re: XOR operator (was Re: C history question) Message-ID: <1860003@hppad.HP.COM> Date: 12 Sep 89 23:53:19 GMT References: <575@calmasd.Prime.COM> Organization: HP Panacom Automation Div Waterloo, Ont. Lines: 22 / hppad:comp.lang.c / wlp@calmasd.Prime.COM (Walter Peterson) / 5:52 pm Sep 10, 1989 / Perhaps someone can answer a question that has bugged me since I first learned C almost 10 years ago. C has bitwise operators for AND (&), OR (|) and XOR (^) and boolean operator for AND (&&) and OR (||), but not for XOR (^^). Why? What happened to the boolean XOR operator ? If && makes sense for the boolean AND and || makes sense for the boolean OR, why doesn't ^^ make sense for the boolean XOR ? Most assemblers that I know have XOR as a single instruction so why make people go to the trouble of writing something like (a || b) && (!(a && b)) when a ^^ b is so much "cleaner". Can anyone tell me why this was left out of the language ? Is there any chance that some future version of ANSI-C will have it ? -- Walt Peterson. Prime - San Diego R&D (Object and Data Management Group) "The opinions expressed here are my own." ----------