in reply to Re: Reduce from 2 to 0.1.
in thread Reduce from 2 to 0.1.

Whenever I needed decimals, to a specific number of places (and not a variable number of places), then I used an int scaled up the appropriate amount,then used a printf("%d.%d",i/100,i%100); (or whatever the scale was) to print.

This avoided FPU use (way back when when FP was really, really slow), and avoided rounding errors.

Of course, if you have a variable amount of decimal places, this might not be feasible.

-lsd