newbie seeks inaccurate arithmetic insight

Stanley Krute StanleyKrute at starband.net
Mon Apr 30 09:31:18 EDT 2001


Hi Tim

> Not unique to Python; same story in C, C++, Java, Perl, Fortran, etc.

Hmmm. Here's a corresponding c program

    http://static.userland.com/images/stanleydaily/carithmeticprogram.gif

and here's its output

    http://static.userland.com/images/stanleydaily/carithmetic.gif

> See
>
>     http://www.python.org/cgi-bin/moinmoin/RepresentationError
>
> for details.

Thanks for the link.

> If you need exact decimal arithmetic, and can afford the expense of
> simulating decimal arithmetic, your best bet for now in Python is to use
the
> FixedPoint class at
>
>
ftp://ftp.python.org/pub/python/contrib-09-Dec-1999/DataStructures/FixedPoin
t.py
>

Thanks again for the link.

> if-you-want-exact-buy-a-one-dollar-hand-calculator

<hehehehe>

stan






More information about the Python-list mailing list