[comp.lang.ada] Fixed point reals

km38#@andrew.cmu.edu.UUCP (02/25/87)

I have access to two compilers, who behave completely differently. With the
following declaration,

type REAL is delta 0.01;

the first one accepts it, and the other one says

   48     type REAL is delta 0.01;
.......................1
%ADAC-E-FIXTYPERANGE, (1) A fixed point type declaration requires a range 
        constraint

I think the second compiler is right in signaling an error, but what about
the first compiler? It is validated with ACVC 1.5.

Thanks,

--Magnus
Arpa: magnus@andrew.cmu.edu
UUCP: seismo!andrew.cmu.edu!magnus

Mendal@SIERRA.STANFORD.EDU (Geoff Mendal) (03/02/87)

All fixed point types must specify a range constraint, in addition
to a "delta" accuracy.  See ARM 3.5.9(3).  Note that the range
constraint is optional for fixed point SUBTYPES.

The reason for requiring the range constraint on the fixed type
definition is that the underlying model numbers are "computed"
using both the delta accuracy and the range constraint.  For a
floating point type definition, model numbers are computed solely
by the digits accuracy, hence the reason why a range constraint
is not required for a floating point type definition.

gom
-------

GOODENOUGH@A.ISI.EDU (John B. Goodenough) (03/02/87)

The declaration

	type REAL is delta 0.01;

should be rejected by a compiler.  The ACVC tests for 1.9 have been greatly
strengthened in the fixed point area, and should detect this deficiency.
-------

keith@telesoft.UUCP (03/04/87)

> 
> type REAL is delta 0.01;
> 

LRM 3.5.9:3 "If the fixed point constraint is used as a real type
definition, then it must include a range constraint; ..."

Obviously the first compiler (validated on 1.5) is incorrect.  It is
entirely possible that the 1.5 ACVC did not test this feature of the
language.

Our compiler produced the following:

	  2: type REAL is delta 0.01;
			  ----------

	>>>    Range constraint required for fixed point type <3.5.9:6>

LRM 3.5.9:6 starts "For a fixed point constraint that includes a range
constraint..."

Keith 
-- 
Keith Allan Shillington  telesoft!keith@UCSD.ARPA       619/457-2700x388.ATT
My opinions are mine.    {ucbvax!sdcsvax,hp-sdd,bigbang}!telesoft!keith.UUCP