Ask Your Question

Mohamed Gaafar's profile - activity

2013-11-16 02:45:10 -0500 asked a question plot arbitrary 2 vectors

I just tried to plot these 2 vectors a and b:

sage: a = [0, 0, 0, 0, 0, 2/25, 13/20, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
sage: b = range(50,70)
sage: plot(a,b)

but an error occurs: ValueError: too many values to unpack any help ???

2013-11-03 22:23:26 -0500 commented answer why using numpy

thank you so much for your reply. The problem is that i am dealing with very large numbers that exceed the ranges fro numpy integers and doubles, so i have to use sage.

2013-11-03 22:20:03 -0500 received badge  Supporter (source)
2013-10-25 08:37:07 -0500 asked a question precision when using numpy

when using numpy, do i have to take care of the ranges for integers, floats, ..etc. and what if the number exceeds the limits for int64 or float64, what shall i do then ? and does this problem exist als for the normal integer data type in sage ('sage.rings.integer.Integer'> ) ???

2013-10-25 08:33:45 -0500 asked a question why using numpy

what is the advantage of using numpy arrays, matrices, integers, floats, ..etc. over the normal ones in sage ??

2013-10-25 08:27:44 -0500 received badge  Editor (source)
2013-10-25 08:11:00 -0500 asked a question 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.