Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

[C] Comparisons versus XOR

Name: Anonymous 2010-11-14 12:39

You're parsing arguments and they are mutually exclusive.


if ((A == 0 && B == 0) || (A != 0 && B!= 0))
 return EXIT_FAILURE;


 versus


if ((A ^ B) == 0)
 return EXIT_FAILURE;

Name: Anonymous 2010-11-15 17:07

Can I ask what is going on here? What was op trying to say? Two mutually exclusive parameters? As in... not equal?

like... != ?
!(A ^ B) === A != B

But the two propositions are not equivalent so how is it a comparison?
I am confuse.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List