up previous next
find the previous prime number
PrevPrime(N: INT): INT
PrevProbPrime(N: INT): INT
The first function computes the largest prime number smaller than
is negative or too large then an error is signalled.
The upper limit depends on the computer you are using;
it is probably 2^31
The second function computes the largest probable prime number greater than
To be absolutely certain the number produced is prime,
you must call
on it, but this may be very costly.