up previous next

NextPrime

Syntax

NextPrime(N:INT):INT
    

Summary

find the next largest prime number

Description

This function computes the smallest prime number greater than N. If N is negative or too large then the value zero is returned. This function may generate primes larger than permitted as the characteristic of a finite field in CoCoA. On most platforms primes up to about 45000 can be generated; in some cases a higher limit exists.

example

    
NextPrime(1000);
1009
-------------------------------
        
    

See Also