nextprime - determine the next largest prime
prevprime - determine the next smallest prime
|
Calling Sequence
|
|
nextprime(n)
prevprime(n)
|
|
Description
|
|
•
|
The nextprime function returns the smallest prime that is larger than n. The prevprime function returns the largest prime that is less than n.
|
|
|
Examples
|
|
>
|
|
| (1) |
>
|
|
| (2) |
>
|
|
>
|
|
| (3) |
>
|
|
| (4) |
>
|
|
| (5) |
>
|
|
| (6) |
>
|
|
| (7) |
>
|
|
| (8) |
|
|
Download Help Document
Was this information helpful?