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);
}
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);
}
http://www.php.net/manual/en/book.bc.php rel=“noreferer”>BC Math 或。 PHP为高价值或高精度业务提供任何工具。
如果你处理大量问题,你就不得不利用允许你这样做的延期。
The s BCMath () , and GMP (。
echo "1241018070217667823424840524103103992616605577501693185388951803611996075221691752992751978120487585576464959501670387052809889858690710767331242032218484364310473577889968548278290754541561964852153468318044293239598173696899657235903947616152278558180061176365108428800000000000000000000000000000000000000000"
确实,你的职责是罚款。 我认为,购买力平价缺乏这种精确性。 我看一看猪肉的价值(正确)
您的数值可能超过了32台轨道机器的最大双精确率(~10^308
)170! 然而,根据这一点,171人! 规模更大。 最好的做法是,在答复时使用EboMike或Crozin建议的图书馆之一。
对大 n来说,你可以 comp! 使用Stirling 近似法的错误非常迅速。 检查这一员额;分析职能和一些抽样守则:
http:// threebrothers.org/brendan/blog/stirlings-approximation-formula-clojure/
这比你能够使用32个轨道拥有的要多。 如果你在64轨计算机上操作同样的代码,那么它就应当工作。
I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...
<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...
I found this script online that creates a thumbnail out of a image but the thumbnail image is created with poor quality how can I improve the quality of the image. And is there a better way to create ...
如何确认来自正确来源的数字。
Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...
I wonder there is a way to post a message to a facebook business page with cURL? thanks
I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...
How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...