yes, switching from IEEE float to double, to increase, you will see bits from a smaller format to a larger format, for example
single
S EEEEEEEE MMMMMMM .....
double
S EEEEEEEEEEEE MMMMM ....
6.5 single
0 10000001 101000 ...
6.5 double
0 10000000001 101000 ...
13 single
0 10000010 101000 ...
13 double
0 10000000010 101000 ...
You leave Mantissa an excuse, and then add zeros.
The exponent is right-aligned, the character expands next to msbit, and then copies msbit.
An indicator, for example, -2. take -2 subtract 1, which is -3. -3 in double complement 0xFD or 0b11111101, but the exponent bits in the format: 0b01111101, msbit is inverted. And for the double indicator -2 -2 -2-1-1 = -3. or 0b1111 ... 1101, and it becomes 0b0111 ... 1101, msbit is inverted. (exponent bits = twos_complement (exponent-1) with inverted msbit).
As we see above, the exponent 3 3-1 = 2 0b000 ... 010 inverts the upper bit 0b100 ... 010
So yes, you can take the bits with a single precision and copy them to the appropriate places in the double-precision number. I don't have an extended reference to float, but I'm sure it works the same.
old_timer Oct 08 '10 at 1:10 2010-10-08 01:10
source share