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

前端 未结 5 450
别那么骄傲
别那么骄傲 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:54

    It depends on the representation, of course. In two's complement, which is widely used, you simply look at the most significant bit.

提交回复
热议问题