math.factorials: include 1.

db4
John Benediktsson 2013-04-08 15:15:49 -07:00
parent cda0092fec
commit 4fa6e09310
1 changed files with 2 additions and 2 deletions

View File

@ -11,8 +11,8 @@ MEMO: factorial ( n -- n! )
: factorial/ ( n k -- n!/k! )
{
{ [ dup 1 < ] [ drop factorial ] }
{ [ over 1 < ] [ nip factorial recip ] }
{ [ dup 1 <= ] [ drop factorial ] }
{ [ over 1 <= ] [ nip factorial recip ] }
[
2dup < [ t ] [ swap f ] if
[ (a,b] product ] dip [ recip ] when