This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author tim.peters
Recipients Ananthakrishnan, lemburg, mark.dickinson, rhettinger, serhiy.storchaka, steven.daprano, stutzbach, tim.peters, veky, vstinner
Date 2020-01-31.00:51:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Raymond, there was a thread a while back about adding an `imath` module, to package the number-theoretic functions that frequently come up.  _All_ these things should really go into that instead, IMO.  `math` started as a thin wrapper around C's libm, and has been losing its once-exclusive focus on functions for working with Python floats.  I think that focus was valuable.

In that older thread, I suggested a `probable_prime(n)` predicate function, and posted my pure-Python Miller-Rabin implementation.  Simple (as such things go), but I wouldn't aim to compete with (say) gmp.

I don't think `is_prime(n)` is suitable for Python.  Proving that a large integer absolutely is prime is either quite slow or quite complicated.  In practice, even professionals in critical applications are happy to settle for probabilistic assurances, because an arbitrarily tiny probability of error can be obtained very much faster than a deterministic proof.

Anyway ;-) , ya, I like the idea, but I'd sure like it to go into a module where it obviously belongs.  Also a function, e.g., to generate primes, and ...
Date User Action Args
2020-01-31 00:51:59tim.peterssetrecipients: + tim.peters, lemburg, rhettinger, mark.dickinson, vstinner, stutzbach, steven.daprano, serhiy.storchaka, veky, Ananthakrishnan
2020-01-31 00:51:59tim.peterssetmessageid: <>
2020-01-31 00:51:59tim.peterslinkissue39479 messages
2020-01-31 00:51:59tim.peterscreate