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,1de1981df403322c X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-11-07 12:10:56 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed-west.nntpserver.com!hub1.meganetnews.com!nntpserver.com!falcon.america.net!eagle.america.net.POSTED!not-for-mail From: Larry Hazel User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.5) Gecko/20031007 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: New limited range type? References: <1068220677.950551@master.nyc.kbcfp.com> <1068224385.790621@master.nyc.kbcfp.com> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Fri, 07 Nov 2003 14:11:21 -0600 NNTP-Posting-Host: 66.0.32.41 X-Trace: eagle.america.net 1068235857 66.0.32.41 (Fri, 07 Nov 2003 15:10:57 EST) NNTP-Posting-Date: Fri, 07 Nov 2003 15:10:57 EST Organization: 24hoursupport.com Xref: archiver1.google.com comp.lang.ada:2228 Date: 2003-11-07T14:11:21-06:00 List-Id: Martin Dowie wrote: > "Hyman Rosen" wrote in message > news:1068224385.790621@master.nyc.kbcfp.com... > >>Martin Dowie wrote: >> >>>Standard operator precedent rules should apply - I can't see >>>that as being outragous? >> >>But Ada doesn't define operator evaluation order, so this would >>be a major change in the language. (Not a bad one, just big.) > > > Well it 'kind of' does in that the order must be "an allowed result > for the left-to-right association". > > You could argue that the case "A := B + C - D," for these 'limited > range' types _can_only_ be equivilent to "A := (B + C) - D;". > > > An analog computer implements saturating arithmetic. Oh my God, how long has it been since anyone saw an analog computer. The sum B + C - D would be computed all at once and would only saturate if the final result was out of range. So, I think the expression should be evaluated in a base type with saturation applied to the result.