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

后端 未结 7 2116
一生所求
一生所求 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:30

    A. There is an even number of possibilities to n-digit binary number, so we can't represent the same range for positive and negative numbers.

    B. We want that every number that begin with 1 will be negative, and every number begin with 0 will be no-negative. (not the opposite, because we want same represent to positive and zero in signed and unsinged. Because of that, 0 is in the half of the positives, so them have one place less.

提交回复
热议问题