in reply to shocking imprecision
I guess 4.39 * 100 becomes 438.9999999999What do you mean, "get it right"? Do you want int(438.9999999999) to return something else than 438?...
What can I do to get the int be right?
If you're using int to round to the nearest integer, you're doing it wrong. That's not what int does - int rounds towards 0. Use (s)printf instead.
|
|---|