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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,54889de51045a215 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-10-13 11:38:15 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!small1.nntp.aus1.giganews.com!border3.nntp.aus1.giganews.com!intern1.nntp.aus1.giganews.com!nntp.giganews.com!nntp.gbronline.com!news.gbronline.com.POSTED!not-for-mail NNTP-Posting-Date: Mon, 13 Oct 2003 13:38:13 -0500 Date: Mon, 13 Oct 2003 13:38:37 -0500 From: Wes Groleau Reply-To: groleau@freeshell.org Organization: Ain't no organization here! User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en, es-mx, pt-br, fr-ca MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: += in ada References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <4iOdnZ7WksmIbBeiXTWJig@gbronline.com> NNTP-Posting-Host: 69.9.86.35 X-Trace: sv3-qs1MR5760/+BFyujx1lLptRlkEzPwJcCrdBQb2c4lrpB0IGCBee5DczjPbv9Ux6KTt1CVuCb4Up1+gg!BX5q4xfl7nTvzfjgSB2YrJqK//gHsqiYL0NI538tlbZzUWWwCNC0pYDa2jpAfkGcetRVZ+cqCCaL X-Complaints-To: abuse@gbronline.com X-DMCA-Complaints-To: abuse@gbronline.com X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Xref: archiver1.google.com comp.lang.ada:782 Date: 2003-10-13T13:38:37-05:00 List-Id: christoph.grein@eurocopter.com quoted: >>> if X * Y > Integer'Last and answered: > X and Y may be kept in registers and also the result, and the registers may well > be able to hold values above Integer'Last. > > The RM specifies that either an exception be raised or the mathematically > correct result (here Boolean True) be returned. [Only when the result is > assigned to an Integer must the exception be raised. There is no assignment in > the if-statement's expression.] which agress with Robert E. -- it's implementation dependent. A simple (though not 100% equivalent) alternative is if Integer'Last / X <= Y (not 100% because if the product just equals Integer'Last it will be rejected, but if I used "<" integer division could let a few overflow values squeak through. -- Wes Groleau Guidelines for judging others: 1. Don't attribute to malice that which can be adequately explained by stupidity. 2. Don't attribute to stupidity that which can be adequately explained by ignorance. 3. Don't attribute to ignorance that which can be adequately explained by misunderstanding.