ID:261956
 
I have two variables: x and y

x&=~y

I don't understand what the ~ operator is doing their. I know the XOR OR and AND binary operators. But the not the NOT operator. I'd appreciate an example and/or an explanation.

Resonating Light
It's the binary opposite.
011100101
100011010
In response to Garthor
Garthor wrote:
It's the binary opposite.
011100101
100011010

So. if y=2 - 10.
Then. x = x & 1(or 01)

Is that correct?
In response to Resonating_Light
Actually, it's more along the lines of x = x & 65533 (1111111111111101)

Interestingly, the ~ operator doesn't handle decimals at all. ~1 == ~1.1