Bitwise OR and AND
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
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
Also, be careful with your |s, ||s, &s and &&s.
The ones with the double symbols (|| and &&) are logical operators as opposed to bitwise ones.
Helpful links:
How To Ask Questions The Smart Way | Google can help with your question | Search MSDN for help with standard C or Windows functions
The ones with the double symbols (|| and &&) are logical operators as opposed to bitwise ones.
Helpful links:
How To Ask Questions The Smart Way | Google can help with your question | Search MSDN for help with standard C or Windows functions
would you like coffee OR tea?
would you like coffee AND tea?
would you like coffee XOR tea?
simple, isn''t it?
would you like coffee AND tea?
would you like coffee XOR tea?
simple, isn''t it?
I don''t know, maybe it should be "do you have coffee and tea?"
Helpful links:
How To Ask Questions The Smart Way | Google can help with your question | Search MSDN for help with standard C or Windows functions
Helpful links:
How To Ask Questions The Smart Way | Google can help with your question | Search MSDN for help with standard C or Windows functions
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]
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]
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?
So,
OR.: would you like coffee and/or tea?
AND: would you like coffee and tea?
XOR: would you like coffee or tea?
CWizard, great sig I was thinking of doing something like that...
but now I can''t, because I would be copying you
"aut viam inveniam aut faciam" - I will either find a way or make one.
MoonStar Projects
but now I can''t, because I would be copying you
"aut viam inveniam aut faciam" - I will either find a way or make one.
MoonStar Projects
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement