From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,34a625e98d6a8792 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news2.google.com!proxad.net!feeder2-1.proxad.net!news2-e.free.fr!not-for-mail X-Attribution: Jaco Newsgroups: comp.lang.ada Subject: Re: The right way to handle this difference in Ada References: <15yc7cceofj1e$.ioaad0q1si6i.dlg@40tude.net> From: Eric Jacoboni Organization: Rogntutdju & Associates Date: Thu, 22 Jul 2004 15:22:24 +0200 Message-ID: User-Agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (darwin) Cancel-Lock: sha1:zlw5tLQb2i1iGRQyF81s27oi7IU= MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit NNTP-Posting-Date: 22 Jul 2004 15:22:24 MEST NNTP-Posting-Host: 81.56.238.119 X-Trace: 1090502544 news2-e.free.fr 4226 81.56.238.119:43610 X-Complaints-To: abuse@proxad.net Xref: g2news1.google.com comp.lang.ada:2345 Date: 2004-07-22T15:22:24+02:00 List-Id: "Dmitry A. Kazakov" 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. -- �ric Jacoboni, n� il y a 1393946375 secondes