The next larger integer after division

Possible duplicate:
How to round the result of an entire department

double d1=11, double d2=2
int i=d1/d2;

i will be 5. But I would like it to return 6. (if the result is 5.01, I would also like 6) How do I do this?

+5
source share
1 answer
int i = (int)Math.Ceiling(d1/d2);
+11
source

All Articles