This math scares me

Grant Edwards grante at visi.com
Tue Mar 13 17:08:30 EST 2001


In article <jwbnews-09D75F.13313313032001 at corp.supernews.com>, John W. Baxter wrote:
>In article <984518199.127140 at newsmaster-04.atnet.at>,
> "Werner Schiendl" <ws-news at gmx.at> wrote:
>
>> True, but even 0.1 and 0.2 need not necessarily be exact values.
>
>Of the single decimal digit numbers, 20% are exact (x.0 and
>x.5, for not huge x).  For two decimal places, it's down to 4%
>(x.00, x.25, x.50, x.75) and it spirals quickly downward from
>there.
>
>Bill Gates got this right in the early days, delivering two
>Basic interpreters: binary floating point for speed, and
>decimal floating point for money and such.  (I never looked at
>how well his interpreters did...I just used them.)

I don't know if you can credit Gates with doing anything other
than following the pack.  Back when I first started doing
software (CP/M 1.7), all language packages for "personal"
computers came with both BCD and binary FP math libraries so
you could do exact monetary calculations if you wanted.

Of course we'd never imagined we'd ever see hardware FP and BCD
libraries were only marginally slower than binary ones. Now
that FP is usually in hardware, BCD FP (or fixed point) will be
pretty slow by comparison.

-- 
Grant Edwards                   grante             Yow!  Imagine--a WORLD
                                  at               without POODLES...
                               visi.com            



More information about the Python-list mailing list