comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <stephen_leake@acm.org>
To: comp.lang.ada@ada-france.org
Subject: Re: Integer-Types
Date: 04 Oct 2004 21:23:50 -0400
Date: 2004-10-04T21:23:50-04:00	[thread overview]
Message-ID: <mailman.187.1096939445.390.comp.lang.ada@ada-france.org> (raw)
In-Reply-To: <cjsnqt$uu7$00$1@news.t-online.com>

"Rick Santa-Cruz" <rick_santa_cruz75@msn.com> writes:

> Hi,
> 
> the more I consider the details and play with the language, the more 
> questions come in my mind... sorry...
> 
> Is the following the same:
> type New_Int is range 1..1000000;
> type New_Int1 is new Integer range 1..1000000;

These are very similar. 

They will be different if Integer'last < New_Int'last; in that case,
the compiler will report a compile time error. 

They will have different base types if the base of Integer is 64 bits,
since New_Int will fit in 32 bits.

The only reason to derive an integer type from another integer type is
to ensure they have the same underlying representation.

-- 
-- Stephe




  parent reply	other threads:[~2004-10-05  1:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-04 23:54 Integer-Types Rick Santa-Cruz
2004-10-05  0:48 ` Integer-Types Jeffrey Carter
2004-10-05  1:12   ` Integer-Types Rick Santa-Cruz
2004-10-05 19:37     ` Integer-Types Jeffrey Carter
2004-10-05  1:23 ` Stephen Leake [this message]
2004-10-05  9:58   ` Integer-Types Rick Santa-Cruz
replies disabled

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