MC logo
Float to Decimal Conversion
[^] Floating-Point Conversion Examples   [^^][^^] Binary/Boolean Main Index
[Decimal to Floating-Point Conversions] [Float to Decimal Conversion]

The Conversion Procedure

The rules for converting a floating point number into decimal are simply to reverse of the decimal to floating point conversion:
  1. If the original number is in hex, convert it to binary.
  2. Separate into the sign, exponent, and mantissa fields.
  3. Extract the mantissa from the mantissa field, and restore the leading one. You may also omit the trailing zeros.
  4. Extract the exponent from the exponent field, and subtract the bias to recover the actual exponent of two. As before, the bias is 2k−1 − 1, where k is the number of bits in the exponent field, giving 3 for the 8-bit format and 127 for the 32-bit.
  5. De-normalize the number: move the binary point so the exponent is 0, and the value of the number remains unchanged.
  6. Convert the binary value to decimal. This is done just as with binary integers, but the place values right of the binary point are fractions.
  7. Set the sign of the decimal number according to the sign bit of the original floating point number: make it negative for 1; leave positive for 0.

If the binary exponent is very large or small, you can convert the mantissa directly to decimal without de-normalizing. Then use a calculator to raise two to the exponent, and perform the multiplication. This will give an approximate answer, but is sufficient in most cases.

Examples Using The Conversion Procedure