I am a newbie of golang, and confused with the "&^" operator.
From the spec, the explanation of "&^" is: bit clear (AND NOT). Per my understanding, it means: x &^ y == x & (^y).
Is my understanding right? Thanks!
I am a newbie of golang, and confused with the "&^" operator.
From the spec, the explanation of "&^" is: bit clear (AND NOT). Per my understanding, it means: x &^ y == x & (^y).
Is my understanding right? Thanks!
Your'understanding is right. You can make it as a "bit operator" And the rules:
1 &^ 1 = 0
1 &^ 0 = 1
0 &^ 0 = 0
0 &^ 1 = 0
Just like x & y
, x ^ y
, x | y
.