Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

peter86

Bitwise OR and AND

This topic is 5651 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
check your lovely c/c++ reference book...
or google, or what ever..

because i''m a nice dude:

0&0 = 0
0&1 = 0
1&0 = 0
1&1 = 1

0|0 = 0
0|1 = 1
1|0 = 1
1|1 = 1



"take a look around" - limp bizkit
www.google.com

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
would you like coffee OR tea?
would you like coffee AND tea?
would you like coffee XOR tea?

simple, isn''t it?

Share this post


Link to post
Share on other sites
For bitwise OR(|) the result is 1 if either of the two bits is 1.

For bitwise AND(&) the result is 1 if BOTH of the two bits is 1, and always 0 otherwise.

For bitwise XOR(^) called "exclusive or" the result is 1 if either of the two bits is 1, BUT NOT IF BOTH are 1 or BOTH are 0.


"aut viam inveniam aut faciam " - I will either find a way or make one.

MoonStar Projects

[edited by - Ronin Magus on December 27, 2002 11:12:21 AM]

Share this post


Link to post
Share on other sites
Just a note; in normal language, "or" is usually equivalent to logical eXclusive OR (XOR). The expression "and/or" is equivalent to logical OR.

So,
OR.: would you like coffee and/or tea?
AND: would you like coffee and tea?
XOR: would you like coffee or tea?


Share this post


Link to post
Share on other sites
Guest Anonymous Poster
quote:
would you like coffee XOR tea?

how would one pronounce this? eks-or or zor?

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!