Re: mpz_prevprime

2020-10-15 Thread Marco Bodrato
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 &

Re: mpz_prevprime

2020-10-15 Thread Marco Bodrato
Ciao, Il Ven, 16 Ottobre 2020 1:47 am, Seth Troisi ha scritto: > On Thu, Oct 15, 2020 at 10:44 AM Niels Möller >> Seth Troisi writes: >> > Technically I can restructure the code to make both use with >> mpz_fdiv_ui >> > static int >> > findnext (mpz_ptr p, >> > - unsigned long(*nextm

Re: mpz_prevprime

2020-10-15 Thread Seth Troisi
On Thu, Oct 15, 2020 at 10:44 AM Niels Möller wrote: > Seth Troisi writes: > > > for nextprime sieving the interval 1,000,000 to 1,000,500 > > p is the start of the interval (1,000,000) in this case > > let prime = 401 > > (-p) % prime = mpz_cdiv_ui(p, prime) = 94 > > the 94th number in the siev

Re: mpz_prevprime

2020-10-15 Thread Niels Möller
Seth Troisi writes: > for nextprime sieving the interval 1,000,000 to 1,000,500 > p is the start of the interval (1,000,000) in this case > let prime = 401 > (-p) % prime = mpz_cdiv_ui(p, prime) = 94 > the 94th number in the sieve (p + 94 = 100094) is the first number > divisible by 401 in the in

Re: mpz_prevprime

2020-10-15 Thread Seth Troisi
On Thu, Oct 15, 2020 at 12:13 AM Niels Möller wrote: > Seth Troisi writes: > > > I modified the patch a tiny bit. Still hoping to get this in for an > > upcoming prime-gap search project. > > Looks pretty good to me. > I updated and attached a new patch with the tests discussed on Oct 3rd > > >

Re: mpz_prevprime

2020-10-15 Thread Niels Möller
Seth Troisi writes: > I modified the patch a tiny bit. Still hoping to get this in for an > upcoming prime-gap search project. Looks pretty good to me. > +static int > +findnext (mpz_ptr p, > + unsigned long(*nextmod_func)(const mpz_t, unsigned long), > + void(*nextseq_func)(m

Re: Toward releasing GMP 6.2.1

2020-10-15 Thread Emmanuel Thomé
Hi, I think that this documentation change has never triggered any sort of decision on whether it goes in or not. https://gmplib.org/list-archives/gmp-devel/2019-January/005182.html E. On Thu, Oct 15, 2020 at 07:14:51AM +0200, Marco Bodrato wrote: > Ciao, > > we are not changing much the gmp-6