Why is it that the bitwise NOT operator (~
in most languages) converts the following values like so:
-2 -> 1
-1 -> 0
0 -> -1
1 -> -2
Shouldn't -2
convert to 2
, 1
convert to -1
, etc.?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…