[Numpy-discussion] bug in oldnumeric.ma

Pierre GM pgmdevlist at gmail.com
Wed May 7 16:55:30 EDT 2008


On Wednesday 07 May 2008 20:38:22 Anne Archibald wrote:
> 2008/5/7 Pierre GM <pgmdevlist at gmail.com>:
> > All,
> >  Yes, there is a problem with ma.power: masking negative data should be
> >  restricted to the case of an exponent between -1. and 1. only, don't you
> >  think ?
>
> No, there's a problem with any fractional exponent (with even
> denominator): x**(3/2) == (x**3)**(1/2). 

Argh. Good point.

> The real
> problem is "how do we predict when power() is going to produce a NaN?"
 An alternative would be to forget about it: let power() output NaNs, and fix 
them afterwards with fix_invalid.




More information about the NumPy-Discussion mailing list