From: Paul Eggert Date: Tue, 1 Jul 2025 19:59:17 +0000 (-0700) Subject: factor: prime comments X-Git-Tag: v9.8~198 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5bab674646dd19ead86d565f42fd581f06094520;p=thirdparty%2Fcoreutils.git factor: prime comments * src/factor.c: Add comments re prime functions. --- diff --git a/src/factor.c b/src/factor.c index b445dc21a5..6b42dc7626 100644 --- a/src/factor.c +++ b/src/factor.c @@ -1337,7 +1337,8 @@ static bool mp_prime_p (mpz_t); Baillie-PSW for single- and/or double-word args. */ enum { USE_BAILLIE_PSW = true }; -/* Is N prime? */ +/* Is N prime? N cannot be even or be a composite number less than + SQUARE_OF_FIRST_OMITTED_PRIME. */ static bool prime_p (mp_limb_t n) { @@ -1425,7 +1426,8 @@ prime_p (mp_limb_t n) } } -/* Is (n1,n0) prime, where n1 != 0? */ +/* Is (n1,n0) prime? (n1,n0) cannot be even or be a composite number + less than SQUARE_OF_FIRST_OMITTED_PRIME. */ static bool prime2_p (mp_limb_t n1, mp_limb_t n0) { @@ -1529,7 +1531,8 @@ prime2_p (mp_limb_t n1, mp_limb_t n0) } } -/* Is N prime, where B^2 / 2 <= N? */ +/* Is N prime? N cannot be even or be a composite number less than + SQUARE_OF_FIRST_OMITTED_PRIME. */ static bool mp_prime_p (mpz_t n) {