Why does -INT_MIN = INT_MIN in a signed, two's complement representation?

后端 未结 7 2117
一生所求
一生所求 2020-11-27 21:59

I still haven\'t found a reason why the lowest signed negative number doesn\'t have an equivalent signed positive number? I mean in a 3 digit binary number for simplicity 10

7条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-27 22:23

    The missing digit is 0. In a mathematical sense, 0 is neither positive nor negative. But in a binary sense, since 0 has no negative bit, it's considered positive. In other words, if you wanted -128 to 128, there couldn't be a 0.

提交回复
热议问题