note 124387 deleted from ref.math by cmb
| From: | cmb@php.net | Date: | Tue, 12 Nov 2019 21:25:14 +0000 |
| Subject: | note 124387 deleted from ref.math by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-213044@lists.php.net to get a copy of this message | ||
Note Submitter: suppsort2010 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: https://elmqal.com/