]> git.ipfire.org Git - thirdparty/coreutils.git/commit
factor: use mpz_probab_prime_p
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 12 Jun 2025 20:51:46 +0000 (13:51 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 10 Jul 2025 00:12:39 +0000 (17:12 -0700)
commita76600cda23a95497c8266368d4837ba828aab8e
tree67a05c27a39b98fbfb8243f93c85e27c0eb0e662
parent5d3fdfd04b5dfa6bd1dc63d48f44c7325561a6c1
factor: use mpz_probab_prime_p

Inspired by a proposal by Torbjörn Granlund in:
https://lists.gnu.org/r/coreutils/2025-01/msg00000.html
* src/factor.c (mp_prime_p): Use mpz_probab_prime_p rather than doing
it by hand, as mpz_probab_prime_p uses Baillie-PSW which is a win.
This removes the need for the ret2 label and goto.
src/factor.c