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.3 required=5.0 tests=BAYES_00,LOTS_OF_MONEY, MAILING_LIST_MULTI,REPLYTO_WITHOUT_TO_CC autolearn=no 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 19:54:03 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!oleane.net!oleane!freenix!enst!enst.fr!not-for-mail From: "Robert C. Leif" Newsgroups: comp.lang.ada Subject: RE: Floating Decimal Package/Library? Date: Tue, 16 Jul 2002 19:53:36 -0700 Organization: ENST, France Sender: comp.lang.ada-admin@ada.eu.org Message-ID: Reply-To: comp.lang.ada@ada.eu.org NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: avanie.enst.fr 1026874442 73999 137.194.161.2 (17 Jul 2002 02:54:02 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Wed, 17 Jul 2002 02:54:02 +0000 (UTC) Return-Path: X-Envelope-From: rleif@rleif.com X-Envelope-To: X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.3416 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Importance: Normal In-Reply-To: Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: comp.lang.ada mail<->news gateway List-Unsubscribe: , Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org Xref: archiver1.google.com comp.lang.ada:27174 Date: 2002-07-16T19:53:36-07:00 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.