How can I ensure that a division of integers is always rounded up?
Asked 07 September, 2021
Viewed 2.7K times
  • 58
Votes

I want to ensure that a division of integers is always rounded up if necessary. Is there a better way than this? There is a lot of casting going on. :-)

(int)Math.Ceiling((double)myInt1 / myInt2)

10 Answer