[Numpy-discussion] bug in oldnumeric.ma
Wed May 7 15:55:30 CDT 2008
On Wednesday 07 May 2008 20:38:22 Anne Archibald wrote:
> 2008/5/7 Pierre GM <email@example.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