On Jan 7, 7:11 am, Case Vanhorsen <[email protected]> wrote:
> Hello,
>
> The current trunk (r2579) is passing all my 64-bit Windows stress tests.
>
> But mpz_nextprime is still returning too many composites. For example,
> gmpy.next_prime(3270400) is returning mpz(3270403).
>
> I thought this was fixed earlier?
Hi Case,
I have just run:
-----------------------------------------------
#include <stdio.h>
#include <stdlib.h>
#include <gmp.h>
#include <assert.h>
int main (int argc, char **argv)
{
mpz_t x, pp;
gmp_randstate_t rs;
char buf[20];
int ret;
gmp_randinit_default(rs);
mpz_init(x);
mpz_init(pp);
mpz_set_str(x, "3270400", 10);
printf("starting at %s, ", mpz_get_str(buf, 10, x));
mpz_nextprime(pp, x);
printf("next likely prime is %s \n\n", mpz_get_str(buf, 10, pp));
return 0;
}
-----------------------------------------------
using the Windows x64 SVN version of MPIR and I got the output:
"starting at 3270400, next likely prime is 3270419"
Also, through GMPY:
Python 3.1.1 (r311:74483, Aug 17 2009, 16:45:59) [MSC v.1500 64 bit
(AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> import gmpy
>>> gmpy.next_prime(3270400)
mpz(3270419)
>>>
I tried this for both win32 and x64 and it all seems fine. So I am
not sure why you are getting wrong results (I did have to correct a
small compilation failure in win32).
Brian
--
You received this message because you are subscribed to the Google Groups
"mpir-devel" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/mpir-devel?hl=en.