Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!gem.mps.ohio-state.edu!ginosko!uunet!ncrlnk!ncr-sd!hp-sdd!ucsdhub!calmasd!wlp From: wlp@calmasd.Prime.COM (Walter Peterson) Newsgroups: comp.lang.c Subject: C history question Keywords: C design, XOR Message-ID: <575@calmasd.Prime.COM> Date: 10 Sep 89 21:52:29 GMT Organization: Prime - San Diego R&D (Object and Data Management Group) Lines: 20 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."