Re: [Numpy-discussion] negative numbers
![](https://secure.gravatar.com/avatar/a8e38bf4e73bc0e576bf6fe9cc533440.jpg?s=120&d=mm&r=g)
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:
From: Yuping Wang <wyupinghhu@163.com> To: numpy-discussion@python.org Cc: Bcc: Date: Tue, 29 Jan 2019 15:22:00 +0800 (CST) Subject: [Numpy-discussion] Numpy-discussion Dear Nmupy developers and users: I am a new user of Numpy ,I have encountered a question about Numpy recently, which need your help. The question is below:
I don know why there are negative numbers can somebody explain to me why these happens Thanks in advance! _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@python.org https://mail.python.org/mailman/listinfo/numpy-discussion
-- 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
participants (1)
-
Slavin, Jonathan