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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7fd5a5da28dace78 X-Google-Attributes: gid103376,public From: matthew_heaney@acm.org (Matthew Heaney) Subject: Re: Renaming Fixed Point Mutiplicative operator in Ada 95 Date: 1998/05/21 Message-ID: #1/1 X-Deja-AN: 355264781 Content-Transfer-Encoding: 8bit References: <3561F32B.2F0B@innotts.co.uk> <6k0na0$po4@gcsin3.geccs.gecm.com> Content-Type: text/plain; charset=ISO-8859-1 Organization: Network Intensive Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1998-05-21T00:00:00+00:00 List-Id: In article <6k0na0$po4@gcsin3.geccs.gecm.com>, John McCabe wrote: (start of quote) matthew_heaney@acm.org (Matthew Heaney) wrote: >We disagree here - as we have in the past. Fair enough. Then how about >enumerating the specific circumstances under which a fixed point >multiply can raise an exception? > >My assumption was that, because the multiplication returns universal >fixed, no exception would be raised. So what would be the point of >overriding the predefined operator in order to handle the "exception"? Are you suggesting that in the example given, if LEFT and RIGHT are both 100, you get no exception and are returned a valid value (i.e. in the range -1000.0 to 1000.0? (end of quote) That is indeed that case. It doesn't matter what the limits of the operands are, because the result of muliply is of type universal fixed, which is unconstrained. (start of quote) If no exception is raised, how do you tell whether the limits of a types range have been exceeded or not? (end of quote) The constraint check happens during assignment, during implicit conversion from universal fixed to the target type.