Integer Math.Next Prime Method
Returns the first prime number following the given number.
Definition
Namespace: Numerics.NET
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.4
C#
The next prime number, if there is one, or -1 if not.
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.4
public static int NextPrime(
int n
)
Parameters
- n Int32
- A 32-bit integer.
Return Value
Int32The next prime number, if there is one, or -1 if not.