mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-11 17:58:41 +00:00
Add comments
This commit is contained in:
parent
449c88cc32
commit
1bdeb7967d
|
|
@ -72,7 +72,7 @@ class Prime
|
|||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function rabinTest(int $n, int $k) : bool
|
||||
public static function rabinTest(int $n, int $k = 10000) : bool
|
||||
{
|
||||
if ($n == 2) {
|
||||
return true;
|
||||
|
|
@ -117,6 +117,16 @@ class Prime
|
|||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create prime numbers
|
||||
*
|
||||
* @param int $n Primes to generate
|
||||
*
|
||||
* @return int[]
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function sieveOfEratosthenes(int $n) : array
|
||||
{
|
||||
$number = 2;
|
||||
|
|
@ -138,6 +148,16 @@ class Prime
|
|||
return $primes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is prime?
|
||||
*
|
||||
* @param int $n Number to test
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public function isPrime(int $n) : bool
|
||||
{
|
||||
$i = 2;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user