Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - Negative number to shaping
Negative number to shaping
0-t will do.

int c,a=6,b = 8;

C= (undigested) (6-8);

c =-c;

printf("%d ",c);

If it is a known negative number, it is possible to find its complement, that is, it can be obtained by using 0-t.

C stores int as 4 bytes, with the high byte stored in the low bit and the low byte stored in the high bit.

The memory in -2 C is111111165438. 38+0 1 1 1 1 1 1 1 1 1 1 1

The memory in 2 C is 0010 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000.

But in the algorithm, C has been processed, and at -t, 1 has been added according to the high and low bits.