Is it true that numpy.lib.scimath.power() only accepts integer powers?

 >>> np.info(scimath.power)
...
 >>> Parameters
 >>> ----------
 >>> x : array_like
 >>>     The input value(s).
 >>> p : array_like of ints

In any case, scimath.power() doesn't complain when you send in a 
non-int, and in fact gives a pretty correct answer:

 >>> scimath.power(-4., .5)
(1.2246063538223773e-16+2j)

Note I'm wondering about any non-integers, not just .5

Also note that the "normal" numpy power() function accepts non-ints:

 >>> np.info(np.power)
...
 >>> Parameters
 >>> ----------
 >>> x1 : array_like
 >>>     The bases.
 >>> x2 : array_like
 >>>     The exponents.
...
 >>> np.power(4, .5)
2.0

(Sorry, I tried to follow the source for scimath.py to see what really 
happens at the C level, but lose the trail as soon as I hit 
numpy.core.umath...)

-Nathaniel

_______________________________________________
NumPy-Discussion mailing list
[email protected]
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to