From: Marc.Graham@SEI.CMU.EDU
Subject: Fixed times Integer
Date: 31 Aug 90 16:17:18 GMT [thread overview]
Message-ID: <9008311617.AA03882@bx.sei.cmu.edu> (raw)
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
next reply other threads:[~1990-08-31 16:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
1990-08-31 16:17 Marc.Graham [this message]
-- strict thread matches above, loose matches on Subject: below --
1990-08-30 15:10 Fixed times Integer "Norman H. Cohen"
1990-08-29 15:54 Marc.Graham
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox