First, we convert+10000.00 into binary, assuming that its type is int (32 bits), then the binary is expressed as:
000000000000000000100100010000' This is called the original code: the binary representation of the absolute value of an integer is called the original code.
Converting a negative number into binary is divided into three steps:
1. First, convert the negative number into the corresponding original code.
The original code of-10000.00 is (that is, the string after+10000.00 is converted into binary):
0000 0000 0000 0000 00 10 0 1 1 1 000 1 0000
2. Then, every bit of the original code is negated to get the negated code. Negative operation: 0 becomes 1 1 becomes 0; The result after inversion is:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 / kloc-0/ 10 1 1000 6 5438+0 1 10 1 1 1 1
3. Add the complement+1 to get the complement.
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 / kloc-0/ 10 1 1000 1 1 1 1 0000
4. Convert the complement obtained by+1 into decimal.
The result is-1000.00.
And then convert it into hexadecimal.