According to the specification this operator is called bit clear:
&^ bit clear (AND NOT) integers
I've never heard of such an operator before, and I'm wondering why is it useful.
It seems to take the left operand and disables all the bits that are turned on in the right operand. Is there any formal description of the operator?
One more thing I noticed is that it's not commutative.
Pseudocode in comarison with ^
:
11110 &^ 100 //11010
11110 ^ 100 //11010
11110 &^ 0 //11110
11110 ^ 0 //11110
11110 &^ 11110 //0
11110 ^ 11110 //0
11110 &^ 111 //11000
11110 ^ 111 //11001
111 &^ 11110 //1
111 ^ 11110 //11001