Math errors in python

Grant Edwards grante at visi.com
Sun Sep 19 19:00:56 CEST 2004


On 2004-09-19, Chris S. <chrisks at NOSPAM.udel.edu> wrote:

> Sqrt is a fair criticism, but Pi equals 22/7, exactly the form this 
> arithmetic is meant for.

<boggle>

> Any decimal can be represented by a fraction, yet not all
> fractions can be represented by decimals. My point is that 
> such simple accuracy should be supported out of the box.

It is.  Just not with floating point.

> So are our brains, yet we somehow manage to compute 12.10 + 8.30 
> correctly using nothing more than simple skills developed in 
> grade-school. You could theoretically compute an infinitely long 
> equation by simply operating on single digits, yet Python, with all of
> its resources, can't overcome this hurtle?

Sure it can.

> However, I understand Python's limitation in this regard. This
> inaccuracy stems from the traditional C mindset, which
> typically dismisses any approach not directly supported in
> hardware. As the FAQ states, this problem is due to the
> "underlying C platform". I just find it funny how a $20
> calculator can be more accurate than Python running on a $1000
> Intel machine.

You're clueless on so many different points, I don't even know
where to start...

-- 
Grant Edwards                   grante             Yow!  I'm also pre-POURED
                                  at               pre-MEDITATED and
                               visi.com            pre-RAPHAELITE!!



More information about the Python-list mailing list