XOR operator (was Re: C history question)
Carlos Bazzarella
bazza at hppad.HP.COM
Wed Sep 13 09:53:19 AEST 1989
/ hppad:comp.lang.c / wlp at 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."
----------
More information about the Comp.lang.c
mailing list