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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.66.141.165 with SMTP id rp5mr34471829pab.47.1412002738175; Mon, 29 Sep 2014 07:58:58 -0700 (PDT) X-Received: by 10.50.108.114 with SMTP id hj18mr302945igb.9.1412002738059; Mon, 29 Sep 2014 07:58:58 -0700 (PDT) Path: border2.nntp.dca1.giganews.com!nntp.giganews.com!a13no5483929igq.0!news-out.google.com!rp1ni7433igb.0!nntp.google.com!uq10no382781igb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 29 Sep 2014 07:58:56 -0700 (PDT) In-Reply-To: <1vtp35phxa6d9$.ni9xlewi7r5v.dlg@40tude.net> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=66.126.103.122; posting-account=KSa2aQoAAACOxnC0usBJYX8NE3x3a1Xq NNTP-Posting-Host: 66.126.103.122 References: <7ab81f91-af1f-4fb1-8aef-c7f692e22f38@googlegroups.com> <72db10f1-7e12-4f8c-8ee5-c2bdce727c09@googlegroups.com> <34da5a39-9fa3-4e8e-a3f9-98f61a4ebcc7@googlegroups.com> <1vtp35phxa6d9$.ni9xlewi7r5v.dlg@40tude.net> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <86b50b2e-57ad-47f3-bdaf-b98abcb722be@googlegroups.com> Subject: Re: Integers and Mathematical Correctness From: Adam Beneschan Injection-Date: Mon, 29 Sep 2014 14:58:58 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: number.nntp.dca.giganews.com comp.lang.ada:189241 Date: 2014-09-29T07:58:56-07:00 List-Id: On Sunday, September 28, 2014 12:47:18 AM UTC-7, Dmitry A. Kazakov wrote: > > Therefore, any=20 > > operation that returns a modular type will automatically convert a > > negative value to the value modulo the modulus. >=20 > No. This is a description of some possible implementation of the operatio= n > based on an integer type. This is not the only one implementation, e.g. > there exist machine instructions directly implementing modular operations > for moduli 2**16, 2**32 ... I'm not sure we're on the same page... I'm talking about modular types in A= da, and my statement is taken directly from RM 3.5.4(19). (Of course, it's= always possible for a clever optimizing compiler to generate code that ski= ps a step.) > I also do not understand how all this might be related to rational number= s, > which are neither integer nor modular.=20 There's no relation. The post from Vincent that started this said "I thing= [sic] there are two problems with the current Ada implementation :", and t= hen he described two separate problems, one dealing with modular types and = one dealing with rational numbers. (It's just a coincidence that both invo= lved division, I think.) -- Adam