Ask Your Question

Mohamed Gaafar's profile - activity

2022-07-22 13:55:54 +0200 received badge  Notable Question (source)
2021-02-23 11:38:51 +0200 received badge  Notable Question (source)
2021-02-23 11:38:51 +0200 received badge  Popular Question (source)
2020-05-02 12:21:12 +0200 received badge  Popular Question (source)
2013-11-16 09:45:10 +0200 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-04 05:23:26 +0200 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-04 05:20:03 +0200 received badge  Supporter (source)
2013-10-25 15:37:07 +0200 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 15:33:45 +0200 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 15:27:44 +0200 received badge  Editor (source)
2013-10-25 15:11:00 +0200 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.