note 21947 added to ref.math
| From: | webkid%webkid.com@php.net | Date: | Fri, 31 May 2002 19:54:02 +0000 |
| Subject: | note 21947 added to ref.math | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-31310@lists.php.net to get a copy of this message | ||
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!
--
http://www.php.net/manual/en/ref.math.php
http://master.php.net/manage/user-notes.php?action=edit+21947
http://master.php.net/manage/user-notes.php?action=delete+21947
http://master.php.net/manage/user-notes.php?action=reject+21947