views:

182

answers:

1

Right now I convert the string containing the decimal number to an integer (ignoring the radix point for now), load it into ST(0), and divide by the correct power of ten to account for the radix point. This seems round about, and requires I have a look up table for some of the powers of 10. Is there a better way to do this?

+1  A: 

Off the top of my head, I'm tempted by the notion of constructing the mantissa part , counting the number of digits, and setting the exponent directly instead of doing division.

Charlie Martin