Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
wat10000
11 months ago
|
parent
|
context
|
favorite
| on:
XOR
C does have a logical XOR, it's the `!=` operator. Unlike other logical operators, it requires the arguments to be normalized to a single truth value. It plays nicely with C's convert-to-boolean operator `!!`.
Findecanor
11 months ago
|
next
[–]
I once failed a a test at a job interview because I hadn't realised that (even after having been programming for twenty years).
gblargg
11 months ago
|
prev
|
next
[–]
No need for the second !: !foo != !bar
wat10000
11 months ago
|
parent
|
next
[–]
True, but you might confuse people if you use a nonstandard construct like this.
wslh
11 months ago
|
prev
[–]
^ ?
8n4vidtmkvmk
11 months ago
|
parent
|
next
[–]
That's bitwise xor
201984
11 months ago
|
parent
|
prev
[–]
That's bitwise, not logical.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: