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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 Path: buffer2.nntp.dca1.giganews.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news.glorb.com!feeder.erje.net!1.eu.feeder.erje.net!news.albasani.net!news.mixmin.net!aioe.org!.POSTED!not-for-mail From: Qun-Ying Newsgroups: comp.lang.ada Subject: Re: Fixed-point question Date: Fri, 26 Jun 2015 16:14:09 -0700 Organization: Aioe.org NNTP Server Message-ID: References: <249bcd57-3074-4566-b8f2-03e6923bfbce@googlegroups.com> <6a104bde-67ea-48a5-a035-6be3f9235d42@googlegroups.com> NNTP-Posting-Host: QG+sVfyUW3QoXBz9uF2CgQ.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0 SeaMonkey/2.33.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: number.nntp.giganews.com comp.lang.ada:193796 Date: 2015-06-26T16:14:09-07:00 List-Id: In my test with Linux x86_64 with FSF GNAT 4.9.2 C1 := 14.664 C2 := 17.000 Small := 3.90625000000000000E-03 1/180 := 5.55555555555555556E-03 With Jeffrey's changes I got: C1 := 14.667 C2 := 18.000 Small := 5.55555555555555556E-03 1/180 := 5.55555555555555556E-03 Patrick Noffke wrote: > On Friday, June 26, 2015 at 11:56:44 AM UTC-5, Jeffrey R. Carter wrote: >> On 06/26/2015 06:20 AM, Patrick Noffke wrote: >>> >>> type Fixed_Type is delta 1.0 / 180.0 range 0.0 .. 65535.0 / 180.0; >> >> What is Fixed_Type'Small? > > It is 1/180. > >> >>> C1 : constant Fixed_Type := Fixed_Type (N / D); >> >> What is C1'Size? >> >> If you really want to use multiples of 1/180, you probably want to do >> >> Delta_And_Small : constant := 1.0 / 180.0; >> >> type Fixed_Type is delta Delta_And_Small range 0.0 .. 65535.0 * Delta_And_Small; >> for Fixed_Type'Small use Delta_And_Small; >> > > I do that in my application. I just did the above for a simple test case. Doing as you suggest does not change the result on either platform. > > Pat >