up previous next
find the next largest prime number
NextPrime(N: INT): INT
PrevPrime(N: INT): INT
The first function computes the smallest prime number greater 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 greatest prime number smaller than
is less than 3 or too large then an error is signalled.