Re: [Numpy-discussion] negative numbers
![](https://secure.gravatar.com/avatar/a8e38bf4e73bc0e576bf6fe9cc533440.jpg?s=120&d=mm&r=g)
Jan. 29, 2019
5:38 a.m.
I'm not sure which numpy version you're using (I don't get that using numpy 1.14.3), but the issue is that for some reason the data type (dtype) of the array is being assumed to be a 4 byte integer or '<i4'. The maximum value for that is 2,147,483,647 whereas 1999**3 = 7,988,005,999. To get the correct result you can specify the dtype: a = np.arange(2000,dtype='<i8')**3 for example. Regards, Jon On Tue, Jan 29, 2019 at 2:54 AM <numpy-discussion-request@python.org> wrote:
-- Jonathan D. Slavin Astrophysicist - High Energy Astrophysics Division Center for Astrophysics | Harvard & Smithsonian Office: (617) 496-7981 | Cell: (781) 363-0035 60 Garden Street | MS 83 | Cambridge, MA 02138
2210
Age (days ago)
2210
Last active (days ago)
0 comments
1 participants
participants (1)
-
Slavin, Jonathan