Provides a set of methods to work with prime numbers.
More...
|
| static int | GetNextPrime (int value) |
| | Gets the next prime number greater than the specified value.
|
| static uint | GetNextPrime (uint value) |
| | Gets the next prime number greater than the specified unsigned value.
|
| static bool | IsPrime (int value) |
| | Determines whether the specified value is a prime number.
|
Provides a set of methods to work with prime numbers.
◆ GetNextPrime() [1/2]
| int GetNextPrime |
( |
int | value | ) |
|
|
static |
Gets the next prime number greater than the specified value.
- Parameters
-
| value | The value to find the next prime number for. |
- Returns
- The next prime number greater than the specified value.
- Exceptions
-
| InvalidOperationException | Thrown when there is no larger prime number in the table. |
◆ GetNextPrime() [2/2]
| uint GetNextPrime |
( |
uint | value | ) |
|
|
static |
Gets the next prime number greater than the specified unsigned value.
- Parameters
-
| value | The unsigned value to find the next prime number for. |
- Returns
- The next prime number greater than the specified unsigned value.
- Exceptions
-
| InvalidOperationException | Thrown when there is no larger prime number in the table. |
◆ IsPrime()
| bool IsPrime |
( |
int | value | ) |
|
|
static |
Determines whether the specified value is a prime number.
- Parameters
-
| value | The value to check for primality. |
- Returns
true if the specified value is a prime number; otherwise, false.