Skip to content

Instantly share code, notes, and snippets.

@ArtemioVegas
Last active September 7, 2017 14:12
Show Gist options
  • Save ArtemioVegas/eccbdf18e7e07bc80878dba0cc413376 to your computer and use it in GitHub Desktop.
Save ArtemioVegas/eccbdf18e7e07bc80878dba0cc413376 to your computer and use it in GitHub Desktop.
Функция вычисления факториала - рекурсивная
<?php
function Factorial_Recursive($number){
$number = (int)$number;
if($number < 0){
return false;
}elseif($number >= 0 && $number <= 1 ){
return 1;
}else{
return $number * Factorial_Recursive($number - 1);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment