Should numpy.sqrt(-1) return 1j rather than nan?
David Goldsmith
David.L.Goldsmith at noaa.gov
Thu Oct 12 02:12:45 CDT 2006
Travis Oliphant wrote:
> David Goldsmith wrote:
>
>> Travis Oliphant wrote:
>>
>>
>>> pearu at cens.ioc.ee wrote:
>>>
>>>
>>>
>>>
>>>> Could sqrt(-1) made to return 1j again?
>>>>
>>>>
>>>>
>>>>
>>> Not in NumPy. But, in scipy it could.
>>>
>>>
>>>
>>>
>> Ohmigod!!! You are definitely going to scare away many, many potential
>> users - if I wasn't obliged to use open source at work, you'd be scaring
>> me away.
>>
> Why in the world does it scare you away. This makes no sense to me.
> If you don't like the scipy version don't use it. NumPy and SciPy are
> not the same thing.
>
I don't use scipy (and don't want to because of the overhead) but it
sounds like I should because if I'm taking the square root of a variable
whose value at run time happens to be real but less than zero, I *want*
the language I'm using to return an imaginary; in other words, it's not
the scipy behavior which "scares" me, its the numpy (which I do/have
been using) behavior. To which you might say, "Well, if that's what you
want, and you have Matlab (as you've said you do), then just use that."
But that's precisely the point: people who don't want to be bothered
with having to be "a bit more care[ful]" (as Chuck put it) - and who can
afford it - are going to be inclined to choose Matlab over numpy.
Perhaps one doesn't care - in the grand scheme of things, it certainly
doesn't matter - but I think that you all should be aware that this
numpy "feature" will be seen by many as more than just a nuisance.
DG
-------------------------------------------------------------------------
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