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!news3.google.com!feeder.news-service.com!news.mixmin.net!news.tornevall.net!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: conversions between fixed-point types Date: Fri, 25 Sep 2009 14:58:45 -0700 Organization: TornevallNET - http://news.tornevall.net Message-ID: References: <4abc8389$1_1@glkas0286.greenlnk.net> <35adcbc7-dec6-45ae-bf80-1ebb7a058507@l35g2000vba.googlegroups.com> NNTP-Posting-Host: 3f4f820da0a4eaf41bd3e8831692f207 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: 5de316edc138fa36e9a1065c3002c3ca X-Complaints-To: abuse@tornevall.net X-Complaints-Language: Spoken language is english or swedish - NOT ITALIAN, FRENCH, GERMAN OR ANY OTHER LANGUAGE! In-Reply-To: <35adcbc7-dec6-45ae-bf80-1ebb7a058507@l35g2000vba.googlegroups.com> X-Validate-Post: http://news.tornevall.net/validate.php?trace=5de316edc138fa36e9a1065c3002c3ca X-SpeedUI: 1738 X-Complaints-Italiano: Parlo la lingua non � italiano User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) X-Posting-User: 9b22bfe2855937f9b3faeec7cfc91295 Xref: g2news2.google.com comp.lang.ada:8478 Date: 2009-09-25T14:58:45-07:00 List-Id: sjw wrote: >> "Adam Beneschan" wrote in message >> news:c8af7daf-9f00-4dbb-ad0d-9ca65e0a83d6@f18g2000prf.googlegroups.com... >> >>> If FpB'Machine_Rounds is FALSE, though, the situation is interesting. >>> 4.9(38) requires that static expressions get *truncated* toward zero, >>> as I read it. But there's no similar requirement for expressions >>> computed at runtime. > This is all very weird. Can I point you to my earlier post at > http://groups.google.com/group/comp.lang.ada/msg/f79a71b9abe7e287 > which (unless I'm deluded) shows GNAT rounding away from zero for > dynamic values even though 'Machine_Rounds is False!! (and I get the > same results on Ubuntu 8.04 with GNAT GPL 2008. I think Beneschan's quote about what the ARM requires when 'Machine_Rounds is False explains this. The compiler is truncating for static expressions as required, but not for dynamic expressions. Perhaps it's rounding, or perhaps taking the value furthest from zero, for dynamic expressions. The ARM doesn't seem to require a specific way of converting for dynamic expressions when 'Machine_Rounds is False. -- Jeff Carter "You cheesy lot of second-hand electric donkey-bottom biters." Monty Python & the Holy Grail 14