You are quite right. I was thinking of the algorithm which always rounds up if there is any remainder -- e.g., if you need to know how many boxes are required to ship N items, if M items will fit in a box. The algorithm you need (which will do the job without any comparisons and conditional operations is (Dividend + Dividend + Divisor) / (Divisor + Divisor) "Cephus�" wrote in message news:vereehn58o9be1@corp.supernews.com... > > > David C. Hoos wrote: > > It's simpler to just add one less than the divisor to the dividend > > before dividing. > > > well look at if the total is 25. in your example, 25+3-1 = 27. That would > give you 27/3 = 9 > > but it is really 25/3 which equals 8 remainder 1 which is not enough to > round up... > > Beau > > > _______________________________________________ > comp.lang.ada mailing list > comp.lang.ada@ada.eu.org > http://ada.eu.org/mailman/listinfo/comp.lang.ada >