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

Konrad Hinsen hinsen at cnrs-orleans.fr
Sat Mar 2 04:30:47 EST 2002


Tim Peters <tim.one at comcast.net> writes:

> > # Python 2.2
> >
> > >>> 1e-200**2
> > Traceback (most recent call last):
> >   File "<stdin>", line 1, in ?
> > OverflowError: (34, 'Numerical result out of range')
> 
> That one is surprising and definitely not intended:  it suggests your
> platform libm is setting errno to ERANGE for pow(1e-200, 2.0), or that your
> platform C headers define INFINITY but incorrectly, or that your platform C
> headers define HUGE_VAL but incorrectly, or that your platform C compiler
> generates bad code, or optimizes incorrectly, for negating and/or comparing

I just tested and found the same behaviour, on RedHat Linux 7.1
running on a Pentium machine. Python 2.1, compiled and running on the
same machine, returns 0. So does the Python 1.5.2 that comes with the
RedHat installation. Although there might certainly be something wrong
with the C compiler and/or header files, something has likely changed
in Python as well in going to 2.2, the only other explanation I see
would be a compiler optimization bug that didn't have an effect with
earlier Python releases.

> OverflowError before.  Please file a bug report with full details about
> which operating system, Python version, compiler and C libraries you're
> using (then it's going to take a wizard with access to all that stuff to
> trace into it and determine the true cause).

I am willing to look into this if no one else does. But it won't be
immediately.

Konrad.
-- 
-------------------------------------------------------------------------------
Konrad Hinsen                            | E-Mail: hinsen at cnrs-orleans.fr
Centre de Biophysique Moleculaire (CNRS) | Tel.: +33-2.38.25.56.24
Rue Charles Sadron                       | Fax:  +33-2.38.63.15.17
45071 Orleans Cedex 2                    | Deutsch/Esperanto/English/
France                                   | Nederlands/Francais
-------------------------------------------------------------------------------




More information about the Python-list mailing list