It's simpler to just add one less than the divisor to the dividend before dividing. "Cephus�" wrote in message news:verddee9cbo317@corp.supernews.com... > > > Cephus� wrote: > > I am trying to remember the "golden rule" for integer division > > rounding. > > > > I am trying to average something (both integers) and I can't remember > > how to round without using floating point. > > > > Like say I am trying to divide 26/3 --- I would get 8 remainder 2 > > > > but that should round up to 9. How can I do this? I know it has > > something to do with the dividend....but I can't for the life of me > > remember. thanks! > > > > Beau > > I figured it out. Thanks for the help (although I was asking how to do > something, not the code to do it, usually you would never get that in a > newsgroup). > > All you do is REM the divisor and dividend. Then double it. If that number > is greater than the divisor, then add one. Otherwise don't... > > Beau > > > _______________________________________________ > comp.lang.ada mailing list > comp.lang.ada@ada.eu.org > http://ada.eu.org/mailman/listinfo/comp.lang.ada >