Yes,i think i would have go with GMP.............
please suggest me other solution of my problem ....
Printable View
Yes,i think i would have go with GMP.............
please suggest me other solution of my problem ....
If you are going to use GMP, I recommend you use C++. The C interface to GMP is... irritating. With the C++ interface, they have overladed operators and other niceties impossible in C. I also forgot to mention that iMalc's library is in C++, with no C interface, AFAIK.
Thn x "CommonTater".......
On linux system it gives warning message while on windows system it gives error message when i was using GCC but with VC++ compiler it's all fine .
Thanx evry1 :-)
You could try to type your constant...
Code:unsigned long long x = 600851475143LL;
I'm surprised that after this many posts nobody outright knew that you simply cannot enter a constant larger than 2^32-1 without specifying a type suffix.
In this case I would use ULL though since you're assigning to an Unsigned Long Long.
If you want to do primality tests for numbers between 2^32 and 2^64, try using the deterministic version of the Miller Rabin test with the first 13 primes.
So I read somewhere that the "absolute" theoretical limit is 2*ln(N)^2; for a 64-bit number, that would equate to trying bases below 3935. But then the maximum is apparently much lower than that (according to Pomerance, Selfridge, et al). I wonder why there is such a huge gap between the two?
I've been wondering that for a little while myself.
I think it must be that the theory was enough to prove that 2ln(n) was sufficient, but in practice less is fine, but no even lower bound has been proven yet.
I'm busy trying to implement the BPSW test myself. Just have the actual Lucas pseudoprime test left to get working.