| [reply] [d/l] [select] |
Right, the " was a typo, and, as I mentioned, if you know the amount of decimal places you need, you scale up, and get rid of decimals entirely. That way you don't have rounding errors due to the inaccuracy of IEEE floating point representation, and it is quite a bit faster (well, it was way back when; I'm not sure now)
And, yes, you are correct, it doesn't round. I wasn't giving a whole block of code to use, just a quick bit to give an example on how it would be done.
I used to do this all the time, about 15 years ago, when most computers did not have FPU's, and were much more inaccurate.
| [reply] |