Python 2.2 seriously crippled for numerical computation?

Justin Sheehy justin at iago.org
Sat Mar 2 11:37:56 EST 2002


Huaiyu Zhu <huaiyu_zhu at yahoo.com> writes:

> There appears to be a serious bug in Python 2.2 that severely limits its
> usefulness for numerical computation:

> # Python 2.2
>
>>>> 1e-200**2
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> OverflowError: (34, 'Numerical result out of range')

I suspect that this is a problem with your local compiler or math library.

On the two most convenient platforms to me, this is properly handled.

Python 2.2 (#1, Dec 28 2001, 09:54:53)
[GCC 2.96 20000306 (experimental)] on sunos5
Type "help", "copyright", "credits" or "license" for more information.
>>> 1e-200**2
0.0

Python 2.2 (#4, Jan 25 2002, 15:55:24)
[GCC 2.95.3 20010315 (release) [FreeBSD]] on freebsd4
Type "help", "copyright", "credits" or "license" for more information.
>>> 1e-200**2
0.0

I don't know a lot of details about platform math implementations, but
if you post your compiler and OS, I suspect that people here will be
more likely to be able to provide useful advice.

-Justin

 





More information about the Python-list mailing list