Photon Fusion 2.0.4

Static Public Member Functions | List of all members
Primes Class Reference

Provides a set of methods to work with prime numbers. More...

Static Public Member Functions

static int GetNextPrime (int value)
 Gets the next prime number greater than the specified value. More...
 
static uint GetNextPrime (uint value)
 Gets the next prime number greater than the specified unsigned value. More...
 
static bool IsPrime (int value)
 Determines whether the specified value is a prime number. More...
 

Detailed Description

Provides a set of methods to work with prime numbers.

Member Function Documentation

◆ GetNextPrime() [1/2]

static int GetNextPrime ( int  value)
static

Gets the next prime number greater than the specified value.

Parameters
valueThe value to find the next prime number for.
Returns
The next prime number greater than the specified value.
Exceptions
InvalidOperationExceptionThrown when there is no larger prime number in the table.

◆ GetNextPrime() [2/2]

static uint GetNextPrime ( uint  value)
static

Gets the next prime number greater than the specified unsigned value.

Parameters
valueThe unsigned value to find the next prime number for.
Returns
The next prime number greater than the specified unsigned value.
Exceptions
InvalidOperationExceptionThrown when there is no larger prime number in the table.

◆ IsPrime()

static bool IsPrime ( int  value)
static

Determines whether the specified value is a prime number.

Parameters
valueThe value to check for primality.
Returns
true if the specified value is a prime number; otherwise, false.