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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,efbbbab26bad9cb X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-06-16 14:59:56 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!arclight.uoregon.edu!wn13feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi.com!sccrnsc02.POSTED!not-for-mail From: "Jeffrey Creem" 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: NNTP-Posting-Host: 66.31.5.146 X-Complaints-To: abuse@attbi.com X-Trace: sccrnsc02 1055800788 66.31.5.146 (Mon, 16 Jun 2003 21:59:48 GMT) NNTP-Posting-Date: Mon, 16 Jun 2003 21:59:48 GMT Organization: AT&T Broadband Date: Mon, 16 Jun 2003 21:59:56 GMT Xref: archiver1.google.com comp.lang.ada:39287 Date: 2003-06-16T21:59:56+00:00 List-Id: "Charles LaCour" wrote in message news:VkbHa.72213$%42.66485@fed1read06... > 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. > Oh well..Thanks for trying. You are correct that this is not about Ada but you are incorrect about the answer. Integer math (C, Ada, C++, etc) truncates. It does not round. It would not matter if the fraction were 0.99999999 it would still truncate. If you did the work in float and converted to an integer, it would of course round but I don't think that is what the original poster was asking.