comp.lang.ada
 help / color / mirror / Atom feed
From: "Jeffrey R. Carter" <spam.jrcarter.not@spam.acm.org>
Subject: Re: conversions between fixed-point types
Date: Fri, 25 Sep 2009 14:58:45 -0700
Date: 2009-09-25T14:58:45-07:00	[thread overview]
Message-ID: <h9jdt4$60a$1@news.tornevall.net> (raw)
In-Reply-To: <35adcbc7-dec6-45ae-bf80-1ebb7a058507@l35g2000vba.googlegroups.com>

sjw wrote:
>> "Adam Beneschan" <a...@irvine.com> 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



  reply	other threads:[~2009-09-25 21:58 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-18 21:35 conversions between fixed-point types Dirk Herrmann
2009-09-18 22:42 ` Adam Beneschan
2009-09-19 12:41 ` Dirk Herrmann
2009-09-19 14:48   ` John B. Matthews
2009-09-20  8:15     ` Dirk Herrmann
2009-09-20 14:22       ` Robert A Duff
2009-09-20 18:55         ` Dirk Herrmann
2009-09-20 20:34           ` Simon Clubley
2009-09-23 20:46             ` Dirk Herrmann
2009-09-27 17:15               ` Simon Clubley
2009-09-27 19:22           ` sjw
2009-09-28 20:18             ` Dirk Herrmann
2009-09-28 18:37           ` Robert A Duff
2009-09-28 20:50             ` Dirk Herrmann
2009-09-20 15:18       ` John B. Matthews
2009-09-20 19:13         ` Dirk Herrmann
2009-09-20 20:09       ` tmoran
2009-09-21 17:24       ` Jeffrey R. Carter
2009-09-23 20:57         ` Dirk Herrmann
2009-09-23 22:28           ` Jeffrey R. Carter
2009-09-24  1:05             ` Adam Beneschan
2009-09-24  3:57               ` Jeffrey R. Carter
2009-09-25  8:47               ` Stuart
2009-09-25 20:41                 ` sjw
2009-09-25 21:58                   ` Jeffrey R. Carter [this message]
2009-09-28 13:40                   ` Stuart
2009-09-26 14:43                 ` Dirk Herrmann
2009-09-28 15:15                   ` Adam Beneschan
2009-09-26 14:31               ` Dirk Herrmann
2009-09-19 18:38   ` tmoran
2009-09-20  8:22 ` sjw
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox