Returns the smallest prime greater than or equal to n.

Namespace: Imsl.Stat
Assembly: ImslCS (in ImslCS.dll) Version: 6.5.0.0

Syntax

C#
public static int NextPrime(
	int n
)
Visual Basic (Declaration)
Public Shared Function NextPrime ( _
	n As Integer _
) As Integer
Visual C++
public:
static int NextPrime(
	int n
)

Parameters

n
Type: System..::.Int32
An int which specifies the first number to try as a prime.

Return Value

An int which specifies a prime greater than or equal to n.

Remarks

If n is less than or equal to 2 then 2 is returned.

See Also