mpz_prevprime

Niels Möller nisse at lysator.liu.se
Fri Oct 16 07:13:24 UTC 2020


Seth Troisi <braintwo at gmail.com> writes:

> I just figured out how to make it generic (but please let's do this in a
> 2nd change).

Cool! But I agree that should be a followup change. If nothing else, it
has a new failure mode, since it must fail if gcd(start, diff) > 1.

> I'd suggest "negative_mod_ui" or "distance_ui" to replace "nextmod_func"
> and  "increment_ui" to replace "nextseq_fun"
> Also potentially adding the comment
>
> -       m = nextmod_fuct(p, prime)
> +      /* Distance to next multiple of prime */
> +      m = negative_mod_ui(p, prime);

Sounds good to me.

Regards,
/Niels

-- 
Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677.
Internet email is subject to wholesale government surveillance.


More information about the gmp-devel mailing list