mutants_r_us_guild wrote:acskurucz wrote:
- Code: Select all
<?php
$factorial="1";
$n=1000;
for($i=1; $i<=$n; ++$i) $factorial=bcmul($factorial, $i);
echo $factorial;
?>
It can handle very very very big numbers.
I turned your code into a function:
function factorial($x){
$factorial="1";
for($i=1; $i<=$x; ++$i) $factorial=bcmul($factorial, $i);
return $factorial;
}
P.S. I incorporated that function into my bot
hehe,

