pimaster: aka Russell Mullens
Geek
Pages
Home
Caped
About
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
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment