This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

64 bit float

I know Keil does not support a 64 bit float.

Does anybody know of a way to create a 64 bit float? Maybe from a 32 bit float? The original data is in a ushort. We to create and read a 64 bit float to interface to an external device. We have no choice.

Parents
  • Note that the exponent is biased and not two-complement, and the big difference in range of the double-precision exponent means that it has a different bias.

    So you would have to extract the exponent from the 32-bit float. Update from 8-bit to 16-bit. Perform an add for changing bias. Shift to the correct location and store.

    For the mantissa, it should be enough to just move the bits. The double will have a number of extra bits at the end, that should be left as zero.

    Starting from a 16-bit integer, there will not be any denormalized values, NaN, +Inf or -Inf.

Reply
  • Note that the exponent is biased and not two-complement, and the big difference in range of the double-precision exponent means that it has a different bias.

    So you would have to extract the exponent from the 32-bit float. Update from 8-bit to 16-bit. Perform an add for changing bias. Shift to the correct location and store.

    For the mantissa, it should be enough to just move the bits. The double will have a number of extra bits at the end, that should be left as zero.

    Starting from a 16-bit integer, there will not be any denormalized values, NaN, +Inf or -Inf.

Children