[Numpy-discussion] RE: Python 2.2 seriously crippled for numerical computation?

Huaiyu Zhu huaiyu at gauss.almadan.ibm.com
Mon Mar 4 17:02:14 EST 2002


On Mon, 04 Mar 2002 03:41:07 -0500, Tim Peters <tim.one at comcast.net> wrote:
>On boxes with this problem, I'm also curious what
>
>import math
>print math.pow(1e-200, 2.0)
>
>does under 2.1.  


Python 2.2 (#1, Feb 28 2002, 16:44:48) 
[GCC 2.95.2 19991024 (release)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import math
>>> print math.pow(1e-200, 2.0)
0.0
>>> 1e-200**2.0
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
OverflowError: (34, 'Numerical result out of range')
>>> 1e-200**2
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
OverflowError: (34, 'Numerical result out of range')


Python 2.1 (#1, Oct  2 2001, 15:35:43) 
[GCC 2.95.2 19991024 (release)] on linux2
Type "copyright", "credits" or "license" for more information.
>>> import math
>>> print math.pow(1e-200, 2.0)
0.0
>>> 1e-200**2.0
0.0
>>> 1e-200**2
0.0


Huaiyu






More information about the Python-list mailing list