comp.lang.ada
 help / color / mirror / Atom feed
From: "Robert C. Leif" <rleif@rleif.com>
Subject: RE: Floating Decimal Package/Library?
Date: Tue, 16 Jul 2002 19:53:36 -0700
Date: 2002-07-16T19:53:36-07:00	[thread overview]
Message-ID: <mailman.1026874442.25524.comp.lang.ada@ada.eu.org> (raw)
In-Reply-To: <LH3Z8.797$Za.56740157@newssvr14.news.prodigy.com>

From: Bob Leif
To: Tom Moran et al.
I do not intend to return to my slide-rule. However, I would like to be
able to optimize the precision of my calculations. Since Turkish Lira
have been mentioned, when one tries to directly calculate currency
equivalents based on the exchange rate between any two currencies,
Ada.Decimal did not appear to permit optimizing the exponent of ratios.
I admit that this is somewhat contrived and one could be US dollar
centric and employ the dollar or one other currency as a common
intermediate.

Again, I would prefer to use decimals for engineering and scientific
calculations.

-----Original Message-----
From: comp.lang.ada-admin@ada.eu.org
[mailto:comp.lang.ada-admin@ada.eu.org] On Behalf Of tmoran@acm.org
Sent: Tuesday, July 16, 2002 6:25 PM
To: comp.lang.ada@ada.eu.org
Subject: RE: Floating Decimal Package/Library?

> > What kind of financial software needs more than 18 decimal digits?
> The problem is not precision. It is the choice of the value for the
> exponent
>
> If I divide X * 10**5 by Y * 10**2, I want the result to be Z * 10**3.
> This is what I did with a slide-rule 50 years ago!
  What's the interest, at 4.75% p.a., for the first month of a $10,000
loan.  To-the-penny accuracy required.  I doubt you could read off all
four digits of $39.58 on your slide rule.  The slide rule and floating
point both have excellent range, but poor precision.  You use both
because they are, respectively, faster than full precision paper and
pencil or a full precision multi-digit arithmetic subroutine package,
and because a few digits and an exponent take less paper/RAM.  It's a
tradeoff of accuracy for speed+space.  Unless there's a speed or space
problem using full 18 digit decimal numbers, you needn't make that
tradeoff - you can cover the entire US GNP and have accuracy to the
penny at the same time by using Ada's decimal fixed point types.




  reply	other threads:[~2002-07-17  2:53 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-12 17:19 Floating Decimal Package/Library? Warren W. Gay VE3WWG
2002-07-12 22:58 ` Robert Wessel
2002-07-12 23:30   ` Dann Corbit
2002-07-15 13:34     ` Warren W. Gay VE3WWG
2002-07-16  5:04       ` Robert C. Leif
2002-07-16  7:01         ` tmoran
2002-07-16 15:50           ` Robert C. Leif
2002-07-17  1:24             ` tmoran
2002-07-17  2:53               ` Robert C. Leif [this message]
2002-07-17  4:41                 ` tmoran
2002-07-17 16:30                   ` Warren W. Gay VE3WWG
2002-07-17 22:09                     ` tmoran
2002-07-29 17:05                       ` Warren W. Gay VE3WWG
2002-07-29 17:41                         ` tmoran
2002-07-30  8:58                           ` Jean-Pierre Rosen
2002-07-30 16:20                           ` John H. Lindsay
2002-07-16 16:32           ` Pascal Obry
2002-07-16 17:53           ` Warren W. Gay VE3WWG
2002-07-17  1:24             ` tmoran
2002-07-17  8:28               ` Vadim Godunko
2002-07-17 13:32                 ` Warren W. Gay VE3WWG
2002-07-22 23:33                   ` Robert I. Eachus
2002-07-23 13:16                     ` Marin David Condic
2002-07-24 15:18                       ` Darren New
2002-07-24 15:43                         ` Hyman Rosen
2002-07-24 16:17                         ` Fraser Wilson
2002-07-17 13:30               ` Warren W. Gay VE3WWG
2002-07-13 21:55 ` Björn Lundin
2002-07-15 13:37   ` Warren W. Gay VE3WWG
2002-07-17 21:56 ` Waldek Hebisch
2002-07-18 14:13   ` Robert C. Leif
2002-07-19 14:41     ` Waldek Hebisch
2002-07-19 17:29   ` Warren W. Gay VE3WWG
2002-07-19 21:50     ` Waldek Hebisch
replies disabled

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