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,LOTS_OF_MONEY autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7cda96e9413b780c X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-07-16 18:25:13 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!arclight.uoregon.edu!news.tufts.edu!uunet!dca.uu.net!prodigy.com!newsmst01.news.prodigy.com!prodigy.com!postmaster.news.prodigy.com!newssvr14.news.prodigy.com.POSTED!3bae8248!not-for-mail From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: RE: Floating Decimal Package/Library? References: X-Newsreader: Tom's custom newsreader Message-ID: NNTP-Posting-Host: 172.140.110.16 X-Complaints-To: abuse@prodigy.net X-Trace: newssvr14.news.prodigy.com 1026869099 ST000 172.140.110.16 (Tue, 16 Jul 2002 21:24:59 EDT) NNTP-Posting-Date: Tue, 16 Jul 2002 21:24:59 EDT Organization: Prodigy Internet http://www.prodigy.com X-UserInfo1: OH\IRYOGTRUSP_@YMZJ\_Q\@TJ_ZTB\MV@BNMRQIMASJETAANVW[AKWZE\]^XQWIGNE_[EBL@^_\^JOCQ^RSNVLGTFTKHTXHHP[NB\_C@\SD@EP_[KCXX__AGDDEKGFNB\ZOKLRNCY_CGG[RHT_UN@C_BSY\G__IJIX_PLSA[CCFAULEY\FL\VLGANTQQ]FN Date: Wed, 17 Jul 2002 01:24:59 GMT Xref: archiver1.google.com comp.lang.ada:27172 Date: 2002-07-17T01:24:59+00:00 List-Id: > > 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.