comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: Question about ordinary fixed point types.
Date: Mon, 16 Aug 2010 19:01:51 -0400
Date: 2010-08-16T19:01:51-04:00	[thread overview]
Message-ID: <wcc8w465fhc.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: 4c69a02b$0$2369$4d3efbfe@news.sover.net

"Peter C. Chapin" <chapinp@acm.org> 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



  reply	other threads:[~2010-08-16 23:01 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-15 21:43 Question about ordinary fixed point types Peter C. Chapin
2010-08-15 21:55 ` Shark8
2010-08-16  0:46   ` Peter C. Chapin
2010-08-16  4:13     ` Jeffrey Carter
2010-08-16  8:57       ` Simon Wright
2010-08-15 22:08 ` Yannick Duchêne (Hibou57)
2010-08-16  1:03   ` Peter C. Chapin
2010-08-16  4:11     ` Jeffrey Carter
2010-08-16 10:03       ` Ludovic Brenta
2010-08-17 14:35         ` sjw
2010-08-17 15:51           ` Ludovic Brenta
2010-08-16 11:31       ` Peter C. Chapin
2010-08-16  9:23     ` Simon Wright
2010-08-16 15:47       ` Simon Wright
2010-08-17 14:37       ` sjw
2010-08-16 11:02 ` Stephen Leake
2010-08-16 11:29   ` Peter C. Chapin
2010-08-16 12:53     ` Dmitry A. Kazakov
2010-08-16 20:28       ` Peter C. Chapin
2010-08-16 20:58         ` Adam Beneschan
2010-08-16 13:01     ` Dmitry A. Kazakov
2010-08-16 14:28     ` Robert A Duff
2010-08-16 20:31       ` Peter C. Chapin
2010-08-16 23:01         ` Robert A Duff [this message]
2010-08-16 23:17           ` Peter C. Chapin
2010-08-17  0:56             ` Robert A Duff
2010-08-17  2:03     ` Stephen Leake
2010-08-20  1:21 ` Yannick Duchêne (Hibou57)
replies disabled

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