Pages

Saturday, February 24, 2007

Simple Code - percentages

I was trying to work out a percentage of one value against another:
(int)((double)num/den*100)
Lots of conversion just to get an int value representation of a percentage.
Simplified:
100 * num / den
Solved.

No comments:

Post a Comment