comp.lang.ada
 help / color / mirror / Atom feed
From: "Jean-Pierre Rosen" <rosen@adalog.fr>
Subject: Re: data types & efficiency
Date: Fri, 5 Mar 2004 11:22:56 +0100
Date: 2004-03-05T11:22:56+01:00	[thread overview]
Message-ID: <udk92c.fhd.ln@skymaster> (raw)
In-Reply-To: c29c7h$hbq$1@e3k.asi.ansaldo.it

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


"Davide" <ppp@ppp.it> a �crit dans le message de news:c29c7h$hbq$1@e3k.asi.ansaldo.it...
> 1) always declare that variable as the *smallest* data type that will hold
> the highest value of its possible range (example: if it can assume values
> from 0 to 150 then declare it as an 8-bit integer);
>
Note the following very useful feature, if you want a type that includes *at least* a certain range:
   type Required is range 0..150;
   subtype Extended is Required'Base;

Extended will provide you with the underlying base type, which should be the minimal hardware efficient type that includes your
requirements.

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





      parent reply	other threads:[~2004-03-05 10:22 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-05  8:02 data types & efficiency Davide
2004-03-05  9:23 ` Vinzent 'Gadget' Hoefler
2004-03-05  9:57   ` Davide
2004-03-05 12:00     ` Vinzent 'Gadget' Hoefler
2004-03-05 15:54       ` Davide
2004-03-05 20:53         ` tmoran
2004-03-08  9:28           ` Davide
2004-03-08  8:58         ` Vinzent 'Gadget' Hoefler
2004-03-08 10:53           ` Davide
2004-03-08 15:27           ` Robert I. Eachus
2004-03-05 10:22 ` Jean-Pierre Rosen [this message]
replies disabled

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