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
ID:261956
Mar 6 2004, 8:38 pm
|
|
In response to Garthor
|
|
Garthor wrote:
It's the binary opposite. 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 |
011100101
100011010