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=0.7 required=5.0 tests=BAYES_00,INVALID_DATE, MSGID_SHORT,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!utgpu!water!watmath!clyde!bellcore!faline!thumper!ulysses!andante!mit-eddie!bu-cs!purdue!decwrl!labrea!sri-unix!garth!smryan From: smryan@garth.UUCP Newsgroups: comp.lang.ada Subject: Re: Ada and decimal arithmetic Message-ID: <839@garth.UUCP> Date: 30 Jun 88 21:03:26 GMT References: <8806291300.AA28408@ajpo.sei.cmu.edu> <1139@cod.NOSC.MIL> Reply-To: smryan@garth.UUCP (Steven Ryan) Organization: INTERGRAPH (APD) -- Palo Alto, CA List-Id: In article <1139@cod.NOSC.MIL> broman@nosc.mil.UUCP (Vincent P. Broman) writes: >Requiring decimal arithmetic in order to support commercial applications >is _so_thoughtless_. No careful programmer would compute in floating >point dollars, when long integer (or long floating) counting by pennies will >avoid roundoff problems. All you need are I/O routines that prefix >a dollar sign and add a decimal point between the hundreds' and tens' place. > >23045 => "$230.45" Simple. How do you compute 1.7% sales tax on $230.45? (You multiply the integers and divide by 1000. Dividing a binary number by 1000 is not cheap especially if the underlying hardware includes decimal arithmetic.)