Python 2.2 seriously crippled for numerical computation?
Huaiyu Zhu
huaiyu_zhu at yahoo.com
Fri Mar 1 23:51:26 EST 2002
There appears to be a serious bug in Python 2.2 that severely limits its
usefulness for numerical computation:
# Python 1.5.2 - 2.1
>>> 1e200**2
inf
>>> 1e-200**2
0.0
# Python 2.2
>>> 1e-200**2
Traceback (most recent call last):
File "<stdin>", line 1, in ?
OverflowError: (34, 'Numerical result out of range')
>>> 1e200**2
Traceback (most recent call last):
File "<stdin>", line 1, in ?
OverflowError: (34, 'Numerical result out of range')
This produces the following serious effects: after hours of numerical
computation, just as the error is converging to zero, the whole thing
suddenly unravels.
Note that try/except is completely useless for this purpose.
I hope this is unintended behavior and that there is an easy fix.
Have any of you experienced this?
Huaiyu
More information about the Python-list
mailing list