]> gitweb.factorcode.org Git - factor.git/commitdiff
math.combinatorics: fix <k-permutations> for k=0
authorolus2000 <alsabak@gmail.com>
Thu, 28 Dec 2023 23:03:48 +0000 (00:03 +0100)
committerDoug Coleman <doug.coleman@gmail.com>
Fri, 29 Dec 2023 14:20:11 +0000 (07:20 -0700)
basis/math/combinatorics/combinatorics.factor

index 113f7759d1802845a1aab02848eb52e4b0cebd44..771dda2624b307e025b4e2db1631151ee32092eb 100644 (file)
@@ -78,7 +78,7 @@ TUPLE: k-permutations length skip k seq ;
     seq length :> n
     n k nPk :> len
     {
-        { [ len k [ zero? ] either? ] [ { } ] }
+        { [ len zero? ] [ { } ] }
         { [ n k = ] [ seq <permutations> ] }
         [ len n factorial over /i k seq k-permutations boa ]
     } cond ;