Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - There is a saying that I have just come into contact with C language: the equivalence of 0xfff 1 and -0x800f is equal to 10-15. What does that mean?
There is a saying that I have just come into contact with C language: the equivalence of 0xfff 1 and -0x800f is equal to 10-15. What does that mean?
Plastic data is stored as binary in memory, and negative numbers are stored as complement.

The complement method of negative numbers: take the absolute value first, take the reciprocal, and then add 1.

Take-15 as an example (two bytes):

-15 Original code:1000000111x800f.

Original code15: 0000000001110x000f.

Inverted:11111111/.

Add 1 to get the complement of-15:11111165438.

The binary of signed plastic data whose first character is 1 is negative. 0x stands for 16 and does not necessarily stand for complement.

Signed plastic data hexadecimal 0x8 is the complement.