From: Marc.Graham@SEI.CMU.EDU
Subject: Fixed times Integer
Date: 29 Aug 90 15:54:45 GMT [thread overview]
Message-ID: <9008291554.AA01285@bx.sei.cmu.edu> (raw)
Section 4.5.5 allows multiplication of an object of any fixed point
type by an object of "the predefined type INTEGER" (Standard.Integer).
Consider the following:
------------
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.
----
This complier will do 32-bit arithmetic, but Integer is 16 bits.
Questions: 1) Is the Alsys complier correct in its complaint? (I think
it is.)
2) Is there an Ada commentary or such to the effect: "Of course, when
the manual *says* INTEGER it doesn't really *mean* INTEGER, ...."?
next reply other threads:[~1990-08-29 15:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
1990-08-29 15:54 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-31 16:17 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