comp.lang.ada
 help / color / mirror / Atom feed
From: reason67@my-deja.com
Subject: Re: Type casting question
Date: 1999/12/21
Date: 1999-12-21T00:00:00+00:00	[thread overview]
Message-ID: <83of3h$352$1@nnrp1.deja.com> (raw)
In-Reply-To: 83o9d0$ul9$1@nnrp1.deja.com

In article <83o9d0$ul9$1@nnrp1.deja.com>,
  Robert Dewar <robert_dewar@my-deja.com> wrote:
> In article <385E87D8.2B44B800@tridsys.com>,

> > type Bit_5 is range 2#0# .. 2#11111#;
> >     for Bit_5'Size use 5;
> > subtype Size_Type is Bit_5;
>
> By the way, it is almost certainly wrong to have the base
> type of Bit_5 be signed.
>
> Almost certainly what you want here is
>
>   type Bit_5 is mod 2 ** 5;

Assuming he is using Ada95 and not Ada 83.

> The size clause is unnecessary in either case, since the
> default size in both cases is obviously 5!

I have used compilers that, unless you specified, put all integer types
to a size of 32 by default. I do not know if the Ada95 LRM specifies
that the type must be sized to the minimum or not.
---
Jeffrey S. Blatt


Sent via Deja.com http://www.deja.com/
Before you buy.




  reply	other threads:[~1999-12-21  0:00 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-12-20  0:00 Type casting question Raju Vemulamanda
1999-12-20  0:00 ` DuckE
1999-12-21  0:00 ` Robert Dewar
1999-12-21  0:00 ` Robert Dewar
1999-12-21  0:00   ` reason67 [this message]
1999-12-21  0:00     ` Robert Dewar
1999-12-21  0:00       ` reason67
1999-12-22  0:00         ` Ted Dennison
1999-12-23  0:00         ` Robert Dewar
1999-12-23  0:00           ` reason67
1999-12-23  0:00             ` Robert Dewar
1999-12-23  0:00             ` reason67
1999-12-23  0:00             ` Robert Dewar
1999-12-23  0:00             ` Larry Kilgallen
1999-12-24  0:00               ` Robert Dewar
1999-12-21  0:00 ` David C. Hoos, Sr.
replies disabled

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