[Numpy-discussion] inconsistency in 10**(-2) or 10**array([-2])

Roberto De Almeida roberto at dealmeida.net
Wed Aug 18 09:31:03 EDT 2010


Hi, Mark.

I think the problem is that array([-2]) is an array of integers, so the
result is also an array of integers. It works fine with array([-2.0]).

--Rob

On Wed, Aug 18, 2010 at 9:42 AM, Mark Bakker <markbak at gmail.com> wrote:

> Hello list,
>
> When I do 10**-2, Python nicely returns 0.02
>
> But with numpy (version 1.3.0), I get zero:
>
> In [492]: 10**array([-2])
> Out[492]: array([0])
>
> Is this the intended behavior?
>
> Thanks, Mark
>
>
>
>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20100818/446cdb4c/attachment.html>


More information about the NumPy-Discussion mailing list