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=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,65b3f028266fd999 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!nx02.iad01.newshosting.com!209.197.12.242.MISMATCH!nx01.iad01.newshosting.com!newshosting.com!198.186.194.249.MISMATCH!news-out.readnews.com!transit3.readnews.com!panix!bloom-beacon.mit.edu!newsswitch.lcs.mit.edu!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Question about ordinary fixed point types. Date: Mon, 16 Aug 2010 10:28:29 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <4c685fac$0$2373$4d3efbfe@news.sover.net> <82aaomvn02.fsf@stephe-leake.org> <4c692129$0$2385$4d3efbfe@news.sover.net> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls6.std.com 1281968896 10270 192.74.137.71 (16 Aug 2010 14:28:16 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Mon, 16 Aug 2010 14:28:16 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:VCO/QjeHI2bU8YfDhSfXH6W1hqs= Xref: g2news1.google.com comp.lang.ada:13412 Date: 2010-08-16T10:28:29-04:00 List-Id: "Peter C. Chapin" writes: > I don't think I'm too concerned about the actual value of Small used. In > fact, I'd like to let the compiler choose so that it can optimize the > code better. Isn't it the case that using a power of two allows for more > efficient code generation for certain mathematical operations? I'm not > sure, but I seem to recall reading that somewhere. If that is true, then > I want that. My machine isn't very fast. I'd expect "*" and "/" to be faster for binary smalls, but I don't think it makes any difference for "+" and "-". Multiplying angles by angles doesn't make much sense... > My original question wasn't about how to force the type to use a Small > that I want, rather it was about how can I be sure to visit every value > of the type in a loop for test purposes. You can test your test. That is, write the loop using the advice elsewhere in this thread, and unchecked-convert each value to an integer of the same size, and see if you get the integer representations you are expecting. By the way, Ada.Numerics.Pi has at least 51 digits. - Bob