note 124341 deleted from ref.math by cmb
| From: | cmb@php.net | Date: | Sun, 27 Oct 2019 08:48:55 +0000 |
| Subject: | note 124341 deleted from ref.math by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-212814@lists.php.net to get a copy of this message | ||
Note Submitter: holdon500 at yahoo 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://www.extraprog.com/