note 123034 deleted from ref.math by cmb
| From: | cmb@php.net | Date: | Sun, 21 Jul 2019 08:55:33 +0000 |
| Subject: | note 123034 deleted from ref.math by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-211653@lists.php.net to get a copy of this message | ||
Note Submitter: sabry97000 at gmail dot com
----
And the reason I needed a Factorial function is because I there were no nPr or nCr functions native
to PHP, either.
function n_pick_r($n,$r){$n=(int)$n; $r=(int)$r;return (fact($n)/fact($n-$r));}
function n_choose_r($n,$r){$n=(int)$n; $r=(int)$r;return (n_pick_r($n,$r)/fact($r));}
Hope that helps someone!
exmple www.pqlme.com php