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.68.91.162 with SMTP id cf2mr10534487pbb.2.1435448478876; Sat, 27 Jun 2015 16:41:18 -0700 (PDT) X-Received: by 10.50.134.201 with SMTP id pm9mr76564igb.17.1435448478840; Sat, 27 Jun 2015 16:41:18 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!news.glorb.com!j8no943480igd.0!news-out.google.com!kd3ni19567igb.0!nntp.google.com!j8no689566igd.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sat, 27 Jun 2015 16:41:18 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=24.6.21.101; posting-account=Qh2kiQoAAADpCLlhT_KTYoGO8dU3n4I6 NNTP-Posting-Host: 24.6.21.101 References: <249bcd57-3074-4566-b8f2-03e6923bfbce@googlegroups.com> <6a104bde-67ea-48a5-a035-6be3f9235d42@googlegroups.com> <21e4185b-bc89-4940-b329-09863ad17344@googlegroups.com> <0320a865-5636-4ac6-81f7-ea56b761ce0d@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Fixed-point question From: Anh Vo Injection-Date: Sat, 27 Jun 2015 23:41:18 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: news.eternal-september.org comp.lang.ada:26505 Date: 2015-06-27T16:41:18-07:00 List-Id: On Saturday, June 27, 2015 at 11:38:11 AM UTC-7, Jeffrey R. Carter wrote: > On 06/27/2015 10:59 AM, Patrick Noffke wrote: > > On Friday, June 26, 2015 at 11:44:07 PM UTC-5, Jeffrey R. Carter wrote: > >> > >> With a small of 1/180: > >> > >> For C1, AFAICT, the compiler will calculate N/D exactly, getting 44/3 = > >> 14.6666...., and then convert this to Fixed_type, getting 2640/180. > >> > >> For C2, "/" for Fixed_Type is used, so N and D are converted to Fixed_Type > >> first. > > > > My question is whether this is the right thing for the compiler to do. > > For C2, definitely. I'm not sure why the type conversion for C1 results in using > the universal-real operator. Because N and D are universal-real. In fact, if N and D are declared as Fixed_Type, C1 and C2 have the same value. Anh Vo