up previous next
NextProbPrime, PrevProbPrime
|
find the next largest probable prime number
NextProbPrime(N: INT): INT
PrevProbPrime(N: INT): INT |
This function computes the smallest probable prime number greater than N.
If N is negative, an error is generated.
To be absolutely certain the number produced is prime,
you must call IsPrime on it, but this may be very costly.
/**/ NextProbPrime(1000);
1009
/**/ NextProbPrime(10^50);
100000000000000000000000000000000000000000000000151
|