Why isn't Python king of the hill?

Nick Perkins nperkins7 at home.com
Sun Jun 3 17:05:33 EDT 2001


"Tim Peters" <tim.one at home.com> wrote in message
news:mailman.991519987.12431.python-list at python.org...

[ paraphrased ]
> > Rational numbers can be as surprising to newbies as anything else...

Indeed.

>>> from math import *
>>> sqrt(2)**2
2.0000000000000004
>>> sin(pi)
1.2246063538223773e-016

Neither of these 'errors' would be eliminated by using Rationals.
I am sure there are many similar examples.

note that:
>>> cos(pi)
-1.0
actually works, for some reason (luck?)






More information about the Python-list mailing list