ASKSAGE: Sage Q&A Forum - Latest question feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 25 Oct 2013 08:11:00 -0500Problem with numpy integers and floatshttps://ask.sagemath.org/question/10656/problem-with-numpy-integers-and-floats/1) 1st problem
sage: import numpy as np
sage: a = np.int64(4343678784233766587)
sage: b = np.int64(149)
sage: a*b
1572096270996914903
the answer is wrong; it should be 647208138850831221463
1) 2nd problem
sage: a = np.int64(3344773437777732743)
sage: b = np.int64(181)
sage: a*b
-3338562194645576845
the answer is negative, How Come ???
1) 3rd problem
sage: a = np.float64(3344773437777732743)
sage: b = np.float64(181)
sage: a*b
6.0540399223776962e+20 #the exact answer is 605403992237769626483
Why doesn't it give me all the numbers instead of this e*20 ???
Moreover, i just used normal int of sage (`<type 'sage.rings.integer.Integer'>`
) without using numpy and it works fine !!!
Thank you in advance.
Mohamed GaafarFri, 25 Oct 2013 08:11:00 -0500https://ask.sagemath.org/question/10656/