Well NumPy is an external library. SymPy numbers exist so that they play well with the rest of the SymPy objects, and also so that division results in rational numbers, which are not natively supported in Python.
I'm not convinced that Python's native int/long is inefficient, and I'm *really* not convinced that you could do better in pure Python (even with NumPy). And there's no way you can do as good as GMP, because that's the gold standard. But please prove me wrong. I haven't stressed Python's big integers to the point of memory error before. Aaron Meurer On Tue, Mar 4, 2014 at 7:53 PM, Ambar Mehrotra <[email protected]> wrote: > @certik, > > I don't have the code with me now as this incident is more than an year old. > I want to implement it in various other functions for huge calculations > which are native to sympy and do not require any external libraries to be > installed. Since sympy has a numbers class this could make for a good > addition to it. > > > On Wednesday, 5 March 2014 06:38:47 UTC+5:30, Ondřej Čertík wrote: >> >> On Tue, Mar 4, 2014 at 4:59 PM, Ambar Mehrotra <[email protected]> >> wrote: >> > Hi, >> > >> > I am Ambar Mehrotra and undergraduate from BITS Pilani, India pursuing >> > Information Systems. >> > I like to play with numbers and have a descent experience with python. >> > >> > I would like to suggest the addition of a 'BigInteger' module in the >> > sympy.core.numbers class. >> > Currently there is no convenient way of storing and working with very >> > large >> > numbers in python. I came across this problem while solving a question >> > of >> > Google Code Jam where python ran out of memory while doing a long >> > calculation. >> > I would like to take user input in form of a string and then use >> > algorithms >> > to do some basic math operations using numpy to make things faster. >> > >> > Please tell me if this idea is worth considering and guide me further if >> > you >> > like it. >> >> SymPy can also use GMP through gmpy through mpmath, so that should be >> able to handle any large integers. >> >> Can you post your code where you need large integers in Python that >> runs out of memory? >> >> Ondrej >> >> > >> > with regards, >> > Ambar Mehrotra. >> > >> > -- >> > You received this message because you are subscribed to the Google >> > Groups >> > "sympy" group. >> > To unsubscribe from this group and stop receiving emails from it, send >> > an >> > email to [email protected]. >> > To post to this group, send email to [email protected]. >> > Visit this group at http://groups.google.com/group/sympy. >> > To view this discussion on the web visit >> > >> > https://groups.google.com/d/msgid/sympy/7ec24c8c-02d0-4e02-afb4-ca35a75207f5%40googlegroups.com. >> > For more options, visit https://groups.google.com/groups/opt_out. > > -- > You received this message because you are subscribed to the Google Groups > "sympy" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/sympy. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sympy/a4532a04-24c8-4047-966e-ea250f880448%40googlegroups.com. > > For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sympy. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/CAKgW%3D6%2BGBZtkq7x%2Bzqd2%2BJeCb0Ny4W_xwTgD9RYOGfPmDX6p5w%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
