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: a07f3367d7,6fabd104d18f3943 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: conversions between fixed-point types Date: Sun, 20 Sep 2009 10:22:59 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1253456579 23426 192.74.137.71 (20 Sep 2009 14:22:59 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Sun, 20 Sep 2009 14:22:59 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:ijwv8ZyRfTuL9IhtSyZCZZ2iFd8= Xref: g2news2.google.com comp.lang.ada:8404 Date: 2009-09-20T10:22:59-04:00 List-Id: Dirk Herrmann writes: > In particular I am disturbed by the fact that the following two lines > produce different results with GNAT, as has been confirmed for GNAT > 3.15p (thanks, tmoran): I don't know, but it might have something to do with the rules for evaluating static expressions. See RM-4.9. You also need to look at G.2.3. I don't remember the exact rules for conversions of fixed point, but I think they do allow some implementation freedom. If you don't like that, then write code to make it do what you want. Or use compatible delta/small values. Note that the rules for decimal fixed point are different. By the way, you can say: for T'Small use T'Delta; to avoid repeating yourself. 3.15p is very old. It would be a good idea to upgrade to a more recent version. - Bob