Should numpy.sqrt(-1) return 1j rather than nan?

Fernando Perez fperez.net at gmail.com
Wed Oct 11 17:59:27 CDT 2006


On 10/11/06, Travis Oliphant <oliphant at ee.byu.edu> wrote:
> Fernando Perez wrote:

> >IMHO, scipy should be within reason a strict superset of numpy.
> >
> >
> This was not the relationship of scipy to Numeric.
>
> For me, it's the fact that scipy *used* to have the behavior that
>
> scipy.sqrt(-1) return 1j
>
> and now doesn't  that is the kicker.

That's fine, my only point was that we should really strive for
consitency between the two.  I think most users should be able to
expect that

numpy.foo(x) == scipy.foo(x)

for all cases where foo exists in both.  The scipy.foo() call might be
faster, or take extra arguments for flexibility, and the above might
only be true within floating point accuracy (since a different
algorithm may be used), but hopefully functions with the same name do
the same thing in both.

I really think breaking this will send quite a few potential users
running for the hills, and this is what I meant by 'superset'. Perhaps
I wasn't clear enough.

Cheers,

f

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642




More information about the Numpy-discussion mailing list