From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00, PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,efbbbab26bad9cb X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-06-15 21:04:08 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!nntp.cs.ubc.ca!nntp-relay.ihug.net!ihug.co.nz!west.cox.net!east.cox.net!cox.net!p01!fed1read06.POSTED!not-for-mail From: "Charles LaCour" Newsgroups: comp.lang.ada References: Subject: Re: how to round integers X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Message-ID: Date: Sun, 15 Jun 2003 21:03:47 -0700 NNTP-Posting-Host: 68.2.75.229 X-Complaints-To: abuse@cox.net X-Trace: fed1read06 1055736245 68.2.75.229 (Mon, 16 Jun 2003 00:04:05 EDT) NNTP-Posting-Date: Mon, 16 Jun 2003 00:04:05 EDT Organization: Cox Communications Xref: archiver1.google.com comp.lang.ada:39214 Date: 2003-06-15T21:03:47-07:00 List-Id: You would get 8 2/3 which becomes 8.66666.... This rounds up to nine because .6 >= .5 I'm not an Ada programmer, but this question is not about Ada so I thought it would be ok. "Cephus�" wrote in message news:veqcdrsf7o7q57@corp.supernews.com... > 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 > >