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.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!sdd.hp.com!ucsd!ucbvax!SEI.CMU.EDU!Marc.Graham From: Marc.Graham@SEI.CMU.EDU Newsgroups: comp.lang.ada Subject: Fixed times Integer Message-ID: <9008311617.AA03882@bx.sei.cmu.edu> Date: 31 Aug 90 16:17:18 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet List-Id: Norm Cohen is correct in his description of why the Alsys compiler behaves the way it does. (To refresh your memory, the question concerns the following Ada text and the accompanying warning.) ------------ procedure junk is type blarb is delta 0.1 range 0.0 .. 32769.0; thing : blarb; begin if thing * 32767 > thing * 32768 then null; end if; end junk; ---------- My Sun Alsys compliers complains in the following way: ------ 8 if thing * 32767 > thing * 32768 then <-1-> 1 *EXP This value is outside the range of the target type. NUMERIC_ERROR will be raised here at run time. ---- Dr. Cohen failed to answer my real question, which is not surprising, considering that I failed to ask it. So my real question is: Why does LRM section 4.5.5, paragraph 10, use Standard.Integer instead of either UNIVERSAL_INTEGER (allowing multiplcation and division of fixeds by integer literals or named numbers) or "any integer type" (allowing those operations for any integer and fixed objects)? Those two alternatives are easily remembered and explained. The situation in 4.5.5 (10) allows for some, but not all, literals and some, but not all, non-literals. Is there any rhyme or reason to this? Marc H. Graham Software Engineering Institute marc@sei.cmu.edu Carnegie Mellon University (412) 268 7784 Pittsburgh, PA 15213