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.
- Convert the number to an integer as if the decimal point were not
present.
- Count the number of digits after the decimal point has been found.
- Include only an appropriate number of significant digits in the
mantissa accumulation.
- Leading zeros are not significant, but must be counted if they follow
the decimal point.
- At the end:
- Float the accumulated mantissa
- Combine the digit counts and the specified exponent, if any.
- Multiply or divide the number by the appropriate power of 10
(from a table).