From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: The right way to handle this difference in Ada
Date: Thu, 22 Jul 2004 15:34:09 +0200
Date: 2004-07-22T15:34:09+02:00 [thread overview]
Message-ID: <s7rwzqts4tbp.15ifggy1w20jb.dlg@40tude.net> (raw)
In-Reply-To: m2smbkch2n.fsf@mac.scrogneugneu.org
On Thu, 22 Jul 2004 15:22:24 +0200, Eric Jacoboni wrote:
> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes:
>
>> 2. Well, if c should be negative then probably:
>>
>> type int_12_type is range -2**12..2**12-1;
>> subtype unsigned_int_12_subtype is
>> int_12_type range 0..int_12_type'Last;
>>
>> a : unsigned_int_12_subtype := 1;
>> b : unsigned_int_12_subtype := 2;
>> c : int_12_type := a - b; -- yields -1
>
> Perhaps i've not understood all the implications of the initial
> question but, imo, a signed int_n_type varies from -2**(n - 1) to
> +2**(n - 1) - 1, not from -2**n to +2**n - 1.
So let n=13 (:-))
--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
next prev parent reply other threads:[~2004-07-22 13:34 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-07-22 10:23 The right way to handle this difference in Ada vic
2004-07-22 11:53 ` Eric Jacoboni
2004-07-22 12:07 ` Nick Roberts
2004-07-22 13:03 ` Dmitry A. Kazakov
2004-07-22 13:22 ` Eric Jacoboni
2004-07-22 13:34 ` Dmitry A. Kazakov [this message]
2004-07-22 13:34 ` Björn Persson
2004-07-22 17:52 ` Georg Bauhaus
2004-07-22 18:10 ` Georg Bauhaus
2004-07-23 3:41 ` Steve
2004-07-23 12:47 ` Marius Amado Alves
2004-07-24 3:14 ` Robert I. Eachus
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox