comp.lang.ada
 help / color / mirror / Atom feed
From: Wiktor Moskwa <wiktorDOTmoskwa@gmail.com>
Subject: Re: Rounding with decimal types
Date: Mon, 26 Nov 2007 08:15:02 +0000 (UTC)
Date: 2007-11-26T08:15:02+00:00	[thread overview]
Message-ID: <fidva6$pkd$1@nemesis.news.tpi.pl> (raw)
In-Reply-To: 13kjevsjmhujaa3@corp.supernews.com

On 25.11.2007, Dennis Lee Bieber <wlfraed@ix.netcom.com> wrote:
> On Sun, 25 Nov 2007 15:36:39 +0000 (UTC), Wiktor Moskwa
><wiktorDOTmoskwa@gmail.com> declaimed the following in comp.lang.ada:
>
>> The problem that I'm trying to solve is what type is best suited
>> for financial arithmetic and money representation.
>>
> 	For this, I'd suggest you define your data type to carry at least
> one decimal place more significance than the monetary unit normally
> supports. That gives you a guard digit on which to apply your own
> rounding algorithm for display (you should probably NOT round values
> that will be used for continued computation -- only round the display
> representation).

Hi Dennis,

Thanks for your hint but I'm only trying to use a tool which is decimal type
in Ada. Guard digit and extended precision would be a good idea if we needed
the best possible accuracy but if the process of computation is well defined 
including what method of rounding to use in which step, extra precision 
would be erroneus.

I'd like to know if there is "round up" and "unbiased rounding"
implemented for decimal types in Ada and if not, how "is it usually done"?
Thank you.

-- 
Wiktor Moskwa



  parent reply	other threads:[~2007-11-26  8:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-25 15:36 Rounding with decimal types Wiktor Moskwa
     [not found] ` <13kjevsjmhujaa3@corp.supernews.com>
2007-11-26  8:15   ` Wiktor Moskwa [this message]
2007-11-26 13:47     ` Dmitry A. Kazakov
2007-11-26 14:55       ` Wiktor Moskwa
  -- strict thread matches above, loose matches on Subject: below --
2007-11-26 12:27 Grein, Christoph (Fa. ESG)
2007-11-26 14:46 ` Wiktor Moskwa
replies disabled

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