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: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: Renaming Fixed Point Mutiplicative operator in Ada 95 Date: 1998/05/23 Message-ID: #1/1 X-Deja-AN: 355823632 References: <3561F32B.2F0B@innotts.co.uk> <01bd84c3$47215d60$440029a1@m00rq900> <01bd8589$5fa05a00$440029a1@m00rq900> X-Complaints-To: usenet@news.nyu.edu X-Trace: news.nyu.edu 895928273 30324 (None) 128.122.140.58 Organization: New York University Newsgroups: comp.lang.ada Date: 1998-05-23T00:00:00+00:00 List-Id: <> Well certainly the problem is aggravated by this restriction. In general, the Ada features are carefully organized to work together, and when you start legislating that certain features not be used, you most certainly are likely to create rough spots. In particular, it is in general not feasible to define your own operators for fixed-point multiplication in the general case anyway. This is because you would need to define n**3 operators where n is the number of fixed-point types you have. For a relatively simple COBOL-like program where it is frequently reasonable to have 50-100 such types, you cannot go defining a million fixed-point multiplication routines! In Ada (as opposed to some arbitrarily legislated subset or dialect), the problem of division by zero being tested by the fixed-point multiplication is solved, at least if Machine_Overflows is True, which is likely for fixed-point (and certainly true in all implementations of which I am aware). This exception can then be caught with whatever granularity you require. Note that if you are using SPARK Ada, then you are in a realm where you most definitely ARE expected to prove that what you do does NOT generate exceptions, so I would think that runtime checks for division by zero would be quite an oddity in such an applicatoin anyway. If there is a need for data validation, it would happen much earlier on.