On Sep 30, 2009, at 6:05 PM, Michael B. Brutman wrote:
On a related note, does anybody have a good method for doing a
floating point multiply in software? Before I steal an existing
floating point emulation lib, I'd like to see if I can cheat and
just write enough code to do the one multiply that I need.
I need to figure out how to do this:
float elapsed = ticks * 0.85;
using purely integer operations.
<rant>
Why do people always seem to want to have elapsed time as a floating
point number?
</rant>
How about:
elapsed = (85 * ticks) / 100.
If you need more scale, try a scaling factor:
scale = 1000
elapsed = (85 * scale * ticks) / 100
TTFN - Guy