posted 19 years ago
you could cast the values to doubles, so as to do a floating-point division, then round up, then after that convert back to integers if needed. the Math class has some rounding functions you might find useful.
or you could do an integer division the way you are, then do aseparate modulus operation to find the remainder, and add 1 to the result of the division if needed depending on what the modulus was. it's your choice which of the methods is more complicated and roundabout, i think.