Opération sur les bits (bitwise operators)
Théorie
OR (tout faux (0) ou c'est vrai (1)) 0 or 0 = 0 0 or 1 = 1 1 or 0 = 1 1 or 1 = 1 OR n, 0 (= n) OR n, n (= 0 seulement si n = 0, sinon !=0) XOR (tout pareil (0) ou tout différent (1)) 0 xor 0 = 0 0 xor 1 = 1 1 xor 0 = 1 1 xor 1 = 0 Propriété : xor n, n est égale à 0
Exemple avec nombre [décimal | binaire]
24 | | 00011000 27 | | 000011011
xor 3 | | xor 00000011 xor 3 | | xor 000000011
===== ============ ====== =============
27 00011011 24 000011000
n | | abcdefgh
xor n | | xor abcdefgh
===== ============
0 00000000
