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=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c3f9348279bab80c,start X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!proxad.net!cleanfeed3-a.proxad.net!nnrp6-2.free.fr!not-for-mail Return-Path: Date: Wed, 07 Feb 2007 07:38:48 +0100 From: "Grein, Christoph (Fa. ESG)" Subject: WG: Static vs dynamic evaluation anomaly? To: comp.lang.ada@ada-france.org MIME-version: 1.0 X-MIMEOLE: Produced By Microsoft Exchange V6.5 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7BIT Content-class: urn:content-classes:message Thread-topic: Static vs dynamic evaluation anomaly? Thread-index: AcdKKtjRYg3mETFwTpOVAWjLhAu1UgAVPo+AAACxJmA= X-MS-Has-Attach: X-MS-TNEF-Correlator: X-OriginalArrivalTime: 07 Feb 2007 06:38:12.0946 (UTC) FILETIME=[8A46FB20:01C74A82] X-Virus-Scanned: amavisd-new at ada-france.org X-BeenThere: comp.lang.ada@ada-france.org X-Mailman-Version: 2.1.9rc1 Precedence: list List-Id: "Gateway to the comp.lang.ada Usenet newsgroup" List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.ada Message-ID: X-Leafnode-NNTP-Posting-Host: 88.191.17.134 Organization: Guest of ProXad - France NNTP-Posting-Date: 07 Feb 2007 07:40:01 MET NNTP-Posting-Host: 88.191.14.223 X-Trace: 1170830401 news-4.free.fr 2071 88.191.14.223:60491 X-Complaints-To: abuse@proxad.net Xref: g2news2.google.com comp.lang.ada:9048 Date: 2007-02-07T07:40:01+01:00 No, this program is absolute correct. Modular types do not overflow, they use modular arithmetic. with Ada.Text_IO; use Ada.Text_IO; procedure test271 is type Six_Bits is mod 2**6; X: constant Six_Bits := 31; Z: constant Integer := 31; begin for J in 0..5 loop Put_Line (Integer 'Image (J) & Six_Bits'Image (X * 2**J) & Integer 'Image ((X * 2**J) mod Six_Bit'Modulus)); end loop; end test271;