On 21/08/2013 06:39, Case Van Horsen wrote:
> Hi Brian,
>
> Can I suggest that the name be changed to next_prime_candidate()?
I have now changed the name as you suggest in my GIT repository.
Brian
--
You received this message because you are subscribed to the Google Groups
"mpir-devel" group
Hi Brian,
Can I suggest that the name be changed to next_prime_candidate()?
I would also recommend keeping the behavior of the equivalently named
GMP functions intact. While I agree that better primality tests are a
good thing, so is keeping MPIR as a viable drop-in replacement for
GMP.
Regards,
On 15/08/2013 07:49, Case Van Horsen wrote:
> Hi,
>
> A user of gmpy2 reported that gmpy2.next_prime() returned composite
> values quite frequently. For example:
>
gmpy2.next_prime(2357*7069-1)==2357*7069
> True
>
> I believe this is caused by the following line in next_likely_prime.c:
>
>
That's a nasty bug!
The 2 was doubtlessly deliberate, but the function shouldn't easily return
composites. I will have to revisit the list posts where this was discussed
and see what was intended.
Obviously, increasing the 2 to 25 will fix the problem in the interim.
Thanks for reporting it. I'v
Hi,
A user of gmpy2 reported that gmpy2.next_prime() returned composite
values quite frequently. For example:
>>> gmpy2.next_prime(2357*7069-1)==2357*7069
True
I believe this is caused by the following line in next_likely_prime.c:
if (mpz_miller_rabin (p, 2, rnd))
The Miller-Rabin test is