How to tell if hex value is negative?

后端 未结 4 1223
野趣味
野趣味 2020-12-16 17:57

I have just learned how to read hexadecimal values. Until now, I was only reading them as positive numbers. I heard you could also write negative hex values.

My issu

4条回答
  •  庸人自扰
    2020-12-16 18:57

    You can tell whether a hexadecimal integer is positive or negative by inspecting its most significant (highest) digit. If the digit is ≥ 8, the number is negative; if the digit is ≤ 7, the number is positive. For example, hexadecimal 8A20 is negative and 7FD9 is positive

提交回复
热议问题