<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">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:</div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">a = np.arange(2000,dtype='<i8')**3</div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">for example.</div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">Regards,</div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">Jon</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jan 29, 2019 at 2:54 AM <<a href="mailto:numpy-discussion-request@python.org">numpy-discussion-request@python.org</a>> wrote:</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">From: Yuping Wang <<a href="mailto:wyupinghhu@163.com" target="_blank">wyupinghhu@163.com</a>><br>To: <a href="mailto:numpy-discussion@python.org" target="_blank">numpy-discussion@python.org</a><br>Cc: <br>Bcc: <br>Date: Tue, 29 Jan 2019 15:22:00 +0800 (CST)<br>Subject: [Numpy-discussion] Numpy-discussion<br><div style="line-height:1.7;color:rgb(0,0,0);font-size:14px;font-family:Arial"><div>Dear Nmupy developers and users:</div><div> I am a new user of Numpy ,<span style="float:none;background-color:transparent;color:rgb(0,0,0);font-family:Arial;font-size:14px;font-style:normal;font-variant:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;display:inline">I have encountered a question about Numpy recently, which need your help. The question is below:</span></div><div><span style="float:none;background-color:transparent;color:rgb(0,0,0);font-family:Arial;font-size:14px;font-style:normal;font-variant:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;display:inline"><br></span></div><div><span style="float:none;background-color:transparent;color:rgb(0,0,0);font-family:Arial;font-size:14px;font-style:normal;font-variant:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;display:inline"><br></span></div><div><span style="float:none;background-color:transparent;color:rgb(0,0,0);font-family:Arial;font-size:14px;font-style:normal;font-variant:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;display:inline"> <img style="border: medium; width: 602px; height: 238px;" src="cid:16899ce3481c10142d51"></span></div><div><span style="float:none;background-color:transparent;color:rgb(0,0,0);font-family:Arial;font-size:14px;font-style:normal;font-variant:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;display:inline"><br></span></div><div><span style="float:none;background-color:transparent;color:rgb(0,0,0);font-family:Arial;font-size:14px;font-style:normal;font-variant:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;display:inline"> I don know why there are negative numbers </span></div><div><span style="float:none;background-color:transparent;color:rgb(0,0,0);font-family:Arial;font-size:14px;font-style:normal;font-variant:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;display:inline"> can somebody explain to me why these happens</span></div><div><span style="float:none;background-color:transparent;color:rgb(0,0,0);font-family:Arial;font-size:14px;font-style:normal;font-variant:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;display:inline"> <span style="float:none;background-color:transparent;color:rgb(0,0,0);font-family:Arial;font-size:14px;font-style:normal;font-variant:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;display:inline">Thanks in advance!</span> </span></div></div>_______________________________________________<br>
NumPy-Discussion mailing list<br>
<a href="mailto:NumPy-Discussion@python.org" target="_blank">NumPy-Discussion@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/numpy-discussion" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/numpy-discussion</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><img src="https://lh6.googleusercontent.com/mJuf9zI6QC5w6HPVCinnLSkpp-RgufOfl7nw1E_aghDflNhusoRbZTuP_0x-RkECQRhIfvPxGMe6zSt6chyXZ7D5DdqtkZPp0q-TE8itKny8VWObWAiZ1aurYWDO0CtZgvJEXfzu" width="350" height="2" style="font-size: 12.6667px; font-family: Arial; white-space: pre-wrap; border: none;"></div><div dir="ltr">Jonathan D. Slavin</div><div dir="ltr">Astrophysicist - High Energy Astrophysics Division</div><div dir="ltr">Center for Astrophysics | Harvard & Smithsonian</div><div dir="ltr">Office: (617) 496-7981 | Cell: (781) 363-0035<br>60 Garden Street | MS 83 | Cambridge, MA 02138</div></div><div dir="ltr"><span><p dir="ltr" style="line-height:1.2;margin-top:0pt;margin-bottom:0pt"><span style="font-size:9.5pt;font-family:Arial;background-color:transparent;vertical-align:baseline;white-space:pre-wrap"><img src="https://lh6.googleusercontent.com/mJuf9zI6QC5w6HPVCinnLSkpp-RgufOfl7nw1E_aghDflNhusoRbZTuP_0x-RkECQRhIfvPxGMe6zSt6chyXZ7D5DdqtkZPp0q-TE8itKny8VWObWAiZ1aurYWDO0CtZgvJEXfzu" width="350" height="2" style="border: none;"></span><span style="font-size:9.5pt;font-family:Arial;background-color:transparent;vertical-align:baseline;white-space:pre-wrap"><br></span></p></span></div></div></div></div></div></div></div></div></div></div>