Re: mpz_powm_ui () for 5.1.2

2017-03-07 Thread Niels Möller
Marco Bodrato writes: > Does "mingw32" means unsigned long is a 32-bit type? > You should use an mpz variable to store values exceeding 2^32... mingw means the microsoft windows abi. And on microsoft windows, "long" is always 32 bits, even on x86_64 (not sure about

Re: mpz_powm_ui () for 5.1.2

2017-03-07 Thread Marco Bodrato
Ciao, Il 2017-03-08 02:17 shen lixing ha scritto: I installed MinGW, then 'mingw-get install mingw32-gmp' , got the gmp 5.1.2 properly. The last release of the library is 6.1.2 . unsigned long long c = 10307e7 - 1; // change c,start point mpz_set_ui(b,c);

mpz_powm_ui () for 5.1.2

2017-03-07 Thread shen lixing
Hi, developer! I installed MinGW, then 'mingw-get install mingw32-gmp' , got the gmp 5.1.2 properly. mpz_powm_ui () give a wrong calculation as below (compared and confirmed by Python): // 2^(c-1) = 1 mod c^2, c = ? #include #include #include int main() { printf("hello, worl