mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-11 14:38:39 +00:00
Basic math functions
This commit is contained in:
parent
357e672ca0
commit
6b5105546f
21
Math/Functions.php
Normal file
21
Math/Functions.php
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
<?php
|
||||||
|
namespace phpOMS\Math;
|
||||||
|
|
||||||
|
class Functions
|
||||||
|
{
|
||||||
|
public static function getGammaInteger(\int $k)
|
||||||
|
{
|
||||||
|
return self::fact($k-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function fact(\int $n, \int $start = 1)
|
||||||
|
{
|
||||||
|
$fact = 1;
|
||||||
|
|
||||||
|
for($i = $start; $i < $n; $i++) {
|
||||||
|
$fact *= $i;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $fact;
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user