up previous next
NextPrime

find the next largest prime number

Syntax
NextPrime(N: INT): INT

Description
This function computes the smallest prime number greater than N. If N 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 or 2^63.

Example
/**/  NextPrime(1000);
1009

See Also