Bitwise operators

operator description instance
& Bitwise AND operation, "AND" operation by binary digits (A & B) will get 12 which is 0000 1100
| Bitwise OR operator, "or" operation by binary digit (A | B) will get 61 which is 0011 1101
^ XOR operator, perform "XOR" operation by binary digits (A ^ B) will get 49 which is 0011 0001
~ Inversion operator, perform "inversion" operation by binary bit (~A) will get -61 which is 1100 0011
<< binary left shift operator A << 2 will get 240 which is 1111 0000
>> binary right shift operator A >> 2 will get 15 which is 0000 1111
Comments