Basic math functions

This commit is contained in:
Dennis Eichhorn 2015-12-25 13:53:42 +01:00
parent 357e672ca0
commit 6b5105546f

21
Math/Functions.php Normal file
View 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;
}
}