From: smryan@garth.UUCP
Subject: Re: Ada and decimal arithmetic
Date: 30 Jun 88 21:03:26 GMT [thread overview]
Message-ID: <839@garth.UUCP> (raw)
In-Reply-To: 1139@cod.NOSC.MIL
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.)
next prev parent reply other threads:[~1988-06-30 21:03 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
1988-06-29 13:03 Ada and decimal arithmetic CONTR47
1988-06-29 15:11 ` Vincent P. Broman
1988-06-30 21:03 ` smryan [this message]
-- strict thread matches above, loose matches on Subject: below --
1988-07-06 19:12 Ada and Decimal Arithmetic Erland Sommarskog
1988-06-28 21:57 Marc.Graham
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox