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,4eca860272d4832b X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!newsfeed2.dallas1.level3.net!news.level3.com!newsfeed-00.mathworks.com!news.tele.dk!feed118.news.tele.dk!news.tele.dk!small.news.tele.dk!newspeer1.se.telia.net!newspeer4.se.telia.net!se.telia.net!proxad.net!cleanfeed2-b.proxad.net!nnrp1-1.free.fr!not-for-mail Return-Path: Date: Wed, 07 Feb 2007 07:24:14 +0100 From: "Grein, Christoph (Fa. ESG)" Subject: AW: Static vs dynamic evaluation anomaly? In-reply-to: <1170792077.235994.10900@q2g2000cwa.googlegroups.com> To: Adam Beneschan , 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+A X-OriginalArrivalTime: 07 Feb 2007 06:23:41.0454 (UTC) FILETIME=[82D3DAE0:01C74A80] 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:25:01 MET NNTP-Posting-Host: 88.191.14.223 X-Trace: 1170829501 news-3.free.fr 29489 88.191.14.223:45954 X-Complaints-To: abuse@proxad.net Xref: g2news2.google.com comp.lang.ada:9047 Date: 2007-02-07T07:25: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;