comp.lang.ada
 help / color / mirror / Atom feed
From: Mats Weber <Mats.Weber@elca-matrix.ch>
Subject: Re: Question about base types
Date: 1997/02/10
Date: 1997-02-10T00:00:00+00:00	[thread overview]
Message-ID: <32FF717F.918@elca-matrix.ch> (raw)
In-Reply-To: dewar.855436075@merv


> Mats, you are confused, the base type (and hence the range of intermediate
> results) is always unconstrained, so that if you write:
> 
>    subtype Real is digits 7 range 0.0 .. 1.0;

should type instead of subtype, right ?

> as in the original result, you will still get an unconstrained 7 digit
> base type.

So you are saying that

   type Real is digits 7 range 0.0 .. 1.0;   -- (1)

and 

   type Real_Base is digits 7;
   subtype Real is Real_Base range 0.0 .. 1.0;   -- (2)

are equivalent except for the existence of the name Real_Base ?

Well that's not what I get from reading RM 3.5.7(10). In the first case,
I get a safe (and base) range of at least -1.0 .. 1.0, and in the
second,
- 10.0 ** 28 .. 10.0 ** 28.

Now I know that this is not true for any reasonable implementation
because floating point base types are always created from a finite set
of representations available on the machine, but according to the RM
there could exist a legal implementation of Ada 95 for which 100.0 is a
possible value of Real'Base in variant (2) but not in variant (1). Or am
I missing soemthing ? (If I am, then the RM is confusing).




  reply	other threads:[~1997-02-10  0:00 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-01-26  0:00 Question about base types Matthew Heaney
1997-01-27  0:00 ` Mats Weber
1997-01-28  0:00   ` Robert A Duff
1997-01-29  0:00   ` Robert Dewar
1997-01-27  0:00 ` Robert A Duff
1997-01-30  0:00   ` Matthew Heaney
1997-01-30  0:00     ` Robert Dewar
1997-01-30  0:00       ` Matthew Heaney
1997-01-30  0:00     ` Matthew Heaney
     [not found]     ` <EACHUS.97Feb3221558@spectre.mitre.org>
     [not found]       ` <dewar.855063927@merv>
     [not found]         ` <EACHUS.97Feb6145918@spectre.mitre.org>
     [not found]           ` <dewar.855276722@merv>
1997-02-07  0:00             ` Mats Weber
1997-02-08  0:00               ` Robert Dewar
1997-02-10  0:00                 ` Mats Weber [this message]
1997-02-11  0:00                   ` Robert Dewar
     [not found]         ` <32FB45D4.2160@watson.ibm.com>
1997-02-10  0:00           ` Robert Dewar
1997-02-08  0:00   ` Robert Dewar
1997-02-09  0:00     ` Matthew Heaney
1997-02-09  0:00       ` Robert Dewar
1997-02-09  0:00         ` Matthew Heaney
1997-02-10  0:00           ` Robert Dewar
1997-02-10  0:00       ` Larry Kilgallen
1997-02-11  0:00   ` Robert I. Eachus
1997-02-12  0:00     ` Robert Dewar
1997-01-28  0:00 ` Robert I. Eachus
1997-01-28  0:00   ` Mats Weber
1997-01-29  0:00 ` Robert I. Eachus
1997-01-30  0:00   ` Robert A Duff
replies disabled

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