Status: Accepted
Owner: asmeurer
Labels: Type-Defect Priority-Medium

New issue 2003 by asmeurer: Use factorint() with limit argument in sympy/core/numbers.py
http://code.google.com/p/sympy/issues/detail?id=2003

Based on this thread: http://groups.google.com/group/sympy/browse_thread/thread/86d45d70f580d5de

There is these lines in Integer._eval_power():

      # The following is an algorithm where we collect perfect roots
       # from the factors of base
       if b > 4294967296:
           # Prevent from factorizing too big integers
           return None

Which are well intentioned, because factoring large numbers can be extremely expensive (exponential) if you send the wrong numbers. But there is a limit option to factorint() that lets you only factor out small integers, no matter how large the original integer is. So I think we should do that instead, because factoring large numbers is *not* expensive if all the factors are small.

Also, I noticed that Intger.factors() is using its own factoring algorithm instead of the Pollard-Rho in factorint(). So that needs to be fixed too.

--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sympy-issues?hl=en.

Reply via email to