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!newsfeed2.dallas1.level3.net!news.level3.com!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 19:01:51 -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> <4c69a02b$0$2369$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 1281999697 27615 192.74.137.71 (16 Aug 2010 23:01:37 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Mon, 16 Aug 2010 23:01:37 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:xNj4ALnnZhmblOA6dnnNWlBlY40= Xref: g2news1.google.com comp.lang.ada:13436 Date: 2010-08-16T19:01:51-04:00 List-Id: "Peter C. Chapin" writes: > On 2010-08-16 10:28, Robert A Duff wrote: > >> 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... > > Probably true. On the other hand I anticipate needing other fixed point > types before I'm done so I think it would serve me well to get used to > using binary smalls. Well, you can use binary smalls when that makes sense -- it doesn't mean you have to get used to using them when it doesn't. For calculations involving money, for example, you should look at decimal fixed point types ("type ... is delta ... digits ..."). >> 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. > > I might try that for interest's sake. If I understand you properly, I'd > have to (re)run that test for each implementation that I use. Can't hurt. But I was more suggesting that such a test would confirm your understanding of things like Fixed'Succ and X := X + Fixed'Small. Especially at the end-points of the range, where fixed point type decls do something weird (and undesirable, IMHO). >...Of course, > I'm not really using very many implementations (just two). Which ones? (Just curious.) - Bob