On Jul 14, 1:47�pm, Paul Rubin <http://phr...@nospam.invalid> wrote: > Mensanator <mensana...@aol.com> writes: > > - unlimited precision integers > > - easy to program > > - IDE not required > > - reasonable speed > > - math library needs to include number theoretic functions > > � like GCD, LCM, Modular Inverse, etc. > > - not fucking retarded like F# > > Have you looked at Haskell? > > > As for negatives, the GMP library doesn't factor. > > Maybe with some MIRACL bindings...
That's the factoring program (factor.exe from the MIRACL package) I made reference to. I don't know how to fix the bug nor how to bind it to Python. What I do (or did at one time) know is how figure out how to recompile it, change the output to be database compatible, consistent messages rather than such useless messages as "this number is prime". The Python program, as it captures the StdOut, can watch for the bug. The bug is that factor.exe occasionally gets stuck on a composite while deep into the factoring process. Sometimes, however, this getting stuck can be resolved if you send the composite back to the beginning and start over. The factor.exe program isn't smart enough to try this, it simply returns COMPOSITE amongst the PRIME_FACTORS. The calling Python program can then collect the unfactored composites and call factor.exe again with each of them sending them back to the start of the factoring. If they successfully factor on the second pass, Python then appends them to the factors from the first pass to achieve a complete factorization that factor.exe can produce in theory but not in practice. -- http://mail.python.org/mailman/listinfo/python-list