On Wed, 30 Sep 2009, 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.
Unless you are deliberately TRYING to waste cycles, then stay clear of
floating point!
What's wrong with:
(int) elapsed = ((int) ticks * (int) 85)/ (int) 100
with remainder.
(or (long) if you are dealing with larger numbers)