comp.lang.ada
 help / color / mirror / Atom feed
From: "Jean-Pierre Rosen" <rosen@adalog.fr>
Subject: Re: ARG Urgent Problems (was: labeling)
Date: Wed, 20 Mar 2002 13:19:42 +0100
Date: 2002-03-20T13:19:42+01:00	[thread overview]
Message-ID: <a79v3g$jvb$1@s1.read.news.oleane.net> (raw)
In-Reply-To: mailman.1016545081.7964.comp.lang.ada@ada.eu.org

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 957 bytes --]


"Christoph Grein" <christoph.grein@eurocopter.com> a �crit dans le message news:
>The only problem being that your compiler might reject to compile this because
>it cannot fulfil the request. My_Int'Base will necessarily be a _signed_integer_
>at least big enough to hold the specified range, will thus need at least 33
>bits, most probably a 64 bit
>type.
True, but there is no requirement that T'Base occupies the same number of bits as T.
I just tried the following with Gnat:
    type Int32 is range 0..2**32-1;
    for Int32'size use 32;
    I : Int32;
    B: Int32'Base;
begin
   Put_Line (Integer'image (I'size));
   Put_Line (Integer'Image (B'size));

And it prints:
32
64

(note the use of 'size on objects rather than types - necessary to get the truth about how much memory space is used)

--
---------------------------------------------------------
           J-P. Rosen (rosen@adalog.fr)
Visit Adalog's web site at http://www.adalog.fr





  reply	other threads:[~2002-03-20 12:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-19 13:36 ARG Urgent Problems (was: labeling) Christoph Grein
2002-03-20 12:19 ` Jean-Pierre Rosen [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-03-20 14:07 Christoph Grein
2002-03-15  8:20 labeling (was: partitioning (was: Future)) Christoph Grein
2002-03-15 11:59 ` ARG Urgent Problems (was: labeling) Larry Kilgallen
2002-03-17 12:59   ` Tarjei T. Jensen
2002-03-17 13:11     ` Nick Williams
2002-03-19  9:22       ` Tarjei T. Jensen
2002-03-19 12:21         ` Jean-Pierre Rosen
2002-03-19 14:38           ` Tarjei T. Jensen
replies disabled

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