[Numpy-discussion] exponentiation q.

2008-07-25 Thread Gideon Simpson
How does python (or numpy/scipy) do exponentiation? If I do x**p, where p is some positive integer, will it compute x*x*...*x (p times), or will it use logarithms? -gideon ___ Numpy-discussion mailing list Numpy-discussion@scipy.org

Re: [Numpy-discussion] exponentiation q.

2008-07-25 Thread Keith Goodman
On Fri, Jul 25, 2008 at 1:24 PM, Gideon Simpson [EMAIL PROTECTED] wrote: How does python (or numpy/scipy) do exponentiation? If I do x**p, where p is some positive integer, will it compute x*x*...*x (p times), or will it use logarithms? Here are some examples: np.array([[1,2], [3,4]])**2

Re: [Numpy-discussion] exponentiation q.

2008-07-25 Thread Keith Goodman
On Fri, Jul 25, 2008 at 1:32 PM, Keith Goodman [EMAIL PROTECTED] wrote: On Fri, Jul 25, 2008 at 1:24 PM, Gideon Simpson [EMAIL PROTECTED] wrote: How does python (or numpy/scipy) do exponentiation? If I do x**p, where p is some positive integer, will it compute x*x*...*x (p times), or will it

Re: [Numpy-discussion] exponentiation q.

2008-07-25 Thread Pauli Virtanen
Fri, 25 Jul 2008 16:24:35 -0400, Gideon Simpson wrote: How does python (or numpy/scipy) do exponentiation? If I do x**p, where p is some positive integer, will it compute x*x*...*x (p times), or will it use logarithms? For floats it will call operating system's pow, which supposedly is