Factorial of 170+
问题 everytime I try to get the factorial of 171, I get INF. 170 works fine. Is it possible to get the factorial of 171+ in a script? How? My function: function factorial($n) { if ($n == 0) return 1; return $n * factorial($n - 1); } 回答1: You'll have to use BC Math or GNU MP extension. PHP doesn't provide any tools for high-values or high-precision operations OOTB. 回答2: If you deal with very large numbers, you'll need to use an extension that allows you to do that. There's BCMath ( http://www.php