Are hexadecimal numbers ever negative?

后端 未结 6 945
感情败类
感情败类 2021-02-14 09:39

Are hexadecimal numbers ever negative? If yes then how?
For binary you would have signed and unsigned.
How would one represent them in Hex? I need this

6条回答
  •  猫巷女王i
    2021-02-14 10:13

    On one hand, why not - it's just a positional numeric system, like decimal.

    On the other hand, they normally use hex notation to deduce the underlying bit pattern - and that is much more straightforward if the number is interpreted as unsigned.

    So the answer is - it's possible, mathematically correct and internally consistent, but defeats the most common purpose of hex notation.

提交回复
热议问题