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

2014-09-03 Thread Alan G Isaac
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))`.

Cheers,
Alan Isaac
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


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

2014-09-03 Thread Charles R Harris
On Wed, Sep 3, 2014 at 3:19 PM, Alan G Isaac alan.is...@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.
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion