odd (?) behavior: negative integer scalar in exponent
![](https://secure.gravatar.com/avatar/a5c6e0b8f64a8a1940f5b2d367c1db6e.jpg?s=120&d=mm&r=g)
Sept. 3, 2014
9:19 p.m.
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
![](https://secure.gravatar.com/avatar/96dd777e397ab128fedab46af97a3a4a.jpg?s=120&d=mm&r=g)
September 2014
11:25 p.m.
On Wed, Sep 3, 2014 at 3:19 PM, Alan G Isaac <alan.isaac@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.
3822
Age (days ago)
3822
Last active (days ago)
1 comments
2 participants
participants (2)
-
Alan G Isaac
-
Charles R Harris