Carlos Grohmann <carlos.grohm...@gmail.com> writes:

> I'd like to hear from you on the benefits of using numpy.power(x,y)
> over (x*x*x*x..)
>
> I looks to me that numpy.power takes more time to run.

You can use math.pow, which is no slower than repeated multiplication,
even for small exponents.

Obviously, after the exponent has grown large enough, numpy.power
becomes faster than repeated exponentiation (it's already faster at
100).  Like math.pow, it supports negative and non-integer exponents.
Unlike math.pow, numpy.power also supports all kinds of interesting
objects as bases for exponentiation.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to