I'm trying to write a function to find the number of twin primes (x and x+2 are both primes) between a and b which can be any very large integer.
If I used just int, the code is like this.
1 2 3 4 5 6 7 8 9 10 11
|
int Count =0;
int twin(int a, int b)
{
for(int i=a;i<=b-2;i++)
if(ProbPrime(i)==true&&ProbPrime(i+2)==true)
Count++;
return Count;
}
|
I have a problem if I want my input to be of type ZZ though. I tried replacing all the ints with ZZ but it doesn't work.
Last edited on
Sorry. I am using NTL. ZZ is an arbitrary precision integer.
Are you including and linking the necessary files?