[(#BALISE|class::methode)]
x! = x*(x-1)*(x-2)*...*3*2*1
).
class Math{
function factorielle($n){
if ($n==0)
return 1;
else
return $n * Math::factorielle($n-1);
}
}
[(#VAL{9}|Math::factorielle)]
// renvoie 362880
[(#BALISE|class::methode)]
x! = x*(x-1)*(x-2)*...*3*2*1
).
class Math{
function factorielle($n){
if ($n==0)
return 1;
else
return $n * Math::factorielle($n-1);
}
}
[(#VAL{9}|Math::factorielle)]
// renvoie 362880
Auteur Publié le : 22/12/08 Mis à jour : 09/11/09
Traductions : English, français, Nederlands