It is awkward to work with floating-point numbers using the bits that represent them instead of using the mathematical form, ±F•be, where b is a fixed base (two for binary floating-point), e is an integer in a specified range, and F is a base-b numeral of fixed length and range. F is called the significand.1
In the mathematical form, 1.0 is +1.000…000•20, and subtracting +1.000…000•20 from +1.000…000•20 yields +0.000…000•20 (the exponent does not matter), and, when we encode that int the IEEE-754 single precision format (binary32), we get the bits 0000…0000 (sign bit 0, exponent field 0000000, significand field 0000…0000).
If you are going to work with the bits directly, you have to develop more details for an algorithm for that. Once you have a result, you must encode it properly. The rules for encoding a binary32 number include:
- If the significand begins with 1, the trailing bits (all bits after the 1) are stored in the significand field, and the exponent field is set to 127+e.
- If the significand begins with 0, the trailing bits are stored in the significand field, and the exponent field is set to 0.
Thus, since you had a significand of 0, you should have set the exponent field to 0.
Footnote
1 “Significand” is the preferred term for the fraction portion of a floating-point representation. “Mantissa” is an old term for the fraction portion of a logarithm. Significands are linear. Mantissas are logarithmic.