More mathmatical functions can be found in the sections BCMath Arbitrary Precision Mathematics Functions and Mathematical Functions.
?php function fact( $x) {if($x = 1) return 1; else return gmp_mul($x,fact($x-1));} print gmp_strval(fact(1000)) ."\n";?