From: Christoph Grein <christoph.grein@eurocopter.com>
Subject: Re: ARG Urgent Problems (was: labeling)
Date: Tue, 19 Mar 2002 14:36:18 +0100 (MET)
Date: 2002-03-19T14:36:18+01:00 [thread overview]
Message-ID: <mailman.1016545081.7964.comp.lang.ada@ada.eu.org> (raw)
From: Jean-Pierre Rosen <rosen@adalog.fr>
> "Tarjei T. Jensen" <tarjei.jensen@kvaerner.com> a écrit dans le message news:
a7700l$84f4@news.kvaerner.com...
> > C allows both integers and unsigned to wrap, but somehow those who decides
> > these things think that therefore Ada unsigned above integer'last must wrap
> > as well.
> >
> Maybe it's just that you missed an important feature of Ada: don't use
predefined types, specify your needs, then declare the
> appropriate types. You want a 32 bits integer without wrapping semantics?
Fine, just declare:
>
> type My_Int is range 0..2**32-1;
>
> Your point is that there is no *predefined* type for this; in other languages
you must rely on predefined types because it is all
> you have - not in Ada.
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.
next reply other threads:[~2002-03-19 13:36 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-03-19 13:36 Christoph Grein [this message]
2002-03-20 12:19 ` ARG Urgent Problems (was: labeling) Jean-Pierre Rosen
-- 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