Bitwise AND and OR

BlitzMax Forums/BlitzMax Programming/Bitwise AND and OR

Tibit(Posted 2006) [#1]
AND is &
OR is |
XOR is ~


TartanTangerine (was Indiepath)(Posted 2006) [#2]
XOR is ~


Tibit(Posted 2006) [#3]
Thanks


Yan(Posted 2006) [#4]
~ is for bitwise compliment too... :o)
A ~ B = A XOR B
     _
~A = A



ImaginaryHuman(Posted 2006) [#5]
In other words

AND is &
OR is |
XOR is ~
NOT is ~

As per previous discussions in other threads, when you do:

a=~b

it does a `NOT B` operation and puts it in a

When you do:

a=b~c

(ie when you include a second variable), it does a `B XOR C` operation and puts it in a.


Tibit(Posted 2006) [#6]
Cool :)