[Numpy-discussion] PS: underflow array([2.9e-131+0j])**3 (why complex give a different result? bug?)

Konrad Hinsen hinsen at cnrs-orleans.fr
Tue Jun 12 04:56:38 CDT 2001


> >>> Numeric.array([2.9e-131])**3
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> OverflowError: math range error
> >>> 2.9e-131**3
> 0.0
> >>> Numeric.array([2.9e-131+0j])**3
> array([ 0.+0.j])
> 
> Now I have a quick solution for my problem, but I have the impression that
> this is a bug, at least I don't understand the underlying logic. If
> somebody can explain it to me?

The power calculation routines for float and complex are completely
different, I suppose the absence of underflow reporting in the latter
is just a side effect.

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 Numpy-discussion mailing list