I think I know how to convert a decimal number into IEEE 754 single-precision floating-point representation, but I want to make sure.
I want to represent 3.398860921 x 10^18 in IEEE 754 single-precision floating-point representation. I know how float rep. is broken down.
31th digit: sign (0 for + and 1 for -) 30-23th digits: represent the exponent 22-0th digits: represent the mantissa (significand)
so sign is obviously 0 since it's a positive number. For the exponent I came up with this (by adding 18 to 127 for the bias) and represented the exponent as: 1001 0001
For the mantissa which would be the 3.398860921 part, I continuously multiplied everything to the right of the decimal by 2, and if it was greater than 1 I marked a 1, otherwise a 0. Then took the new answer and again multiplied everything to the right of the decimal by 2, until I came up with enough bits to fill the mantissa.
So now I have: 0 | 1001 0001 | 0110 0110 0001 1011 1011 111
so when I convert this into HEX, I get 0x48B30DDF but that is a different number than I began with in the 3.398860921 x 10^18
Is that supposed to be like that or did I make a mistake somewhere? Any help would be greatly appreciated.