How to know if a binary integral number represents a negative number?

前端 未结 5 455
别那么骄傲
别那么骄傲 2021-02-04 00:06

I am reading some C text. In the Negative and Positive Values session, the author mentioned several ways of representing a negative number in binary form.

I understood a

5条回答
  •  时光取名叫无心
    2021-02-04 00:53

    You must be required to know the type(signed/unsigned) of the number to determine negative/positive number. If type is not mentioned then by default it is signed . If it is signed then you can look MSB bit to determine positive or negative no . If it is mentioned as unsigned then you have to count MSB bit to make decimal no .

提交回复
热议问题