[Numpy-discussion] odd (?) behavior: negative integer scalar in exponent

Charles R Harris charlesr.harris at gmail.com
Wed Sep 3 19:25:03 EDT 2014


On Wed, Sep 3, 2014 at 3:19 PM, Alan G Isaac <alan.isaac at gmail.com> wrote:

> What should be the value of `2**np.int_(-32)`?
> It is apparently currently computed as `1. / (2**np.int_(32))`,
> so the computation overflows (when a C long is 32 bits).
> I would have hoped for it to be computed as `1./(2.**np.int_(32))`.
>
>
Looks like a bug to me.

Chuck.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20140903/85687b94/attachment.html>


More information about the NumPy-Discussion mailing list