mpz_prevprime

Marco Bodrato bodrato at mail.dm.unipi.it
Fri Oct 16 06:53:19 UTC 2020


Post scriptum:

Il Ven, 16 Ottobre 2020 7:13 am, Marco Bodrato ha scritto:
>    m = mpz_tdiv_ui(p, prime);
>    m = (diff > 0) ? prime - m : m;

I remember that, in this context, if p = 0 (mod prime), the result m =
prime is as good as the result m = 0. Because the next two lines are:
     if (m & 1)
       m += prime;

Ĝis,
m



More information about the gmp-devel mailing list