Contents    Page-10    Prev    Next    Page+10    Index   

Floating Point Numbers

Numbers containing a decimal point can be converted in a manner similar to that used for integers.

The important thing to note is that the decimal point is only a place marker to denote the boundary between the integer and fraction parts.

  1. Convert the number to an integer as if the decimal point were not present.

  2. Count the number of digits after the decimal point has been found.

  3. Include only an appropriate number of significant digits in the mantissa accumulation.

  4. Leading zeros are not significant, but must be counted if they follow the decimal point.

  5. At the end:
    1. Float the accumulated mantissa

    2. Combine the digit counts and the specified exponent, if any.

    3. Multiply or divide the number by the appropriate power of 10 (from a table).