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=unavailable autolearn_force=no version=3.4.4 Path: buffer2.nntp.dca1.giganews.com!border2.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!feeder.erje.net!1.eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: Fixed-point question Date: Sat, 27 Jun 2015 11:38:07 -0700 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: 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> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Injection-Date: Sat, 27 Jun 2015 18:36:47 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="a3855fbfe1a666be9aefba0563039ed5"; logging-data="29224"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/CgSJE3PJBBvhLMZWQUdBAEKtsmM26vrA=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 In-Reply-To: <0320a865-5636-4ac6-81f7-ea56b761ce0d@googlegroups.com> Cancel-Lock: sha1:x0bWChTHlTfCa/6SeyBSQvvcAwI= Xref: number.nntp.giganews.com comp.lang.ada:193804 Date: 2015-06-27T11:38:07-07:00 List-Id: 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. -- Jeff Carter "My brain hurts!" Monty Python's Flying Circus 21