Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Game Development Dictionary


Bitwise Operators


Operators (such as And, Or, Not, and Xor) that do operations on the bits of an integeral type.

Modification by Michael Tanczos

Operations:
A AND B
C/C++ : A & B

Truth Table
-----------
      0  1
    /-----
  0 | 0  0
  1 | 0  1
  
Translation: Yields true if A and B are true

--------------------

A OR B
C/C++ : A | B

Truth Table
-----------
      0  1
    /-----
  0 | 0  1
  1 | 1  1

Translation: Yields true if either A or 
B is true


--------------------

NOT B
C/C++ : ~B
NOT is an operator which negates a bit value

--------------------

A XOR B
C/C++ : A ^ B

Truth Table
-----------
      0  1
    /-----
  0 | 0  1
  1 | 1  0

Translation: Yields true if A and B are different




0 Comments


PARTNERS