[Numpy-discussion] Pow() with negative exponent

Ivan Vilata i Balaguer ivilata at carabos.com
Tue May 23 05:52:14 EDT 2006


En/na Pujo Aji ha escrit::

> Numpy optimize the python process by explicitly define the element type
> of array.
> Just like C++.
>
> Python let you work with automatic converting... but it slows down the
> process.
> Like having extra code to check the type of your element array.
>
> I suggest you check the numpy reference instead of python reference then
> using numpy.

OK, I see that predictability of the type of the output result matters.
;)  Besides that, I've been told that, according to the manual, power()
(as every other ufunc) uses its ``types`` member to find out the type of
the result depending only on the types of its arguments.  It makes sense
to avoid checking for particular values with possibly large arrays for
efficiency, as you point out.

I expected Python-like behaviour, but I understand this is not the most
appropriate thing to do for a high-performace package (but then, I was
not able to find out using the public docs).

Thanks for your help,

::

	Ivan Vilata i Balaguer   >qo<   http://www.carabos.com/
	       Cárabos Coop. V.  V  V   Enjoy Data
	                          ""

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 307 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20060523/d05b126d/attachment-0001.sig>


More information about the NumPy-Discussion mailing list