comp.lang.ada
 help / color / mirror / Atom feed
* Fixed point reals
@ 1987-02-25  2:35 km38#
  1987-03-01 23:13 ` Geoff Mendal
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: km38# @ 1987-02-25  2:35 UTC (permalink / raw)
  To: outnews#ext.nn.comp.lang.ada


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Fixed point reals
  1987-02-25  2:35 Fixed point reals km38#
@ 1987-03-01 23:13 ` Geoff Mendal
  1987-03-02 14:45 ` John B. Goodenough
  1987-03-04 20:37 ` keith
  2 siblings, 0 replies; 4+ messages in thread
From: Geoff Mendal @ 1987-03-01 23:13 UTC (permalink / raw)


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
-------

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Fixed point reals
  1987-02-25  2:35 Fixed point reals km38#
  1987-03-01 23:13 ` Geoff Mendal
@ 1987-03-02 14:45 ` John B. Goodenough
  1987-03-04 20:37 ` keith
  2 siblings, 0 replies; 4+ messages in thread
From: John B. Goodenough @ 1987-03-02 14:45 UTC (permalink / raw)


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.
-------

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Fixed point reals
  1987-02-25  2:35 Fixed point reals km38#
  1987-03-01 23:13 ` Geoff Mendal
  1987-03-02 14:45 ` John B. Goodenough
@ 1987-03-04 20:37 ` keith
  2 siblings, 0 replies; 4+ messages in thread
From: keith @ 1987-03-04 20:37 UTC (permalink / raw)


> 
> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1987-03-04 20:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1987-02-25  2:35 Fixed point reals km38#
1987-03-01 23:13 ` Geoff Mendal
1987-03-02 14:45 ` John B. Goodenough
1987-03-04 20:37 ` keith

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox