summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2014-07-28 18:56:55 -0700
committerKaz Kylheku <kaz@kylheku.com>2014-07-28 18:56:55 -0700
commitb9e5782453ab8f89ac15219b4d20301f7c19545a (patch)
treeccf1d991ed35364384c3b13ba0c03fd879aa443a
parent49116fad12857d46afa7865be3331bdfa0944fa5 (diff)
downloadtxr-b9e5782453ab8f89ac15219b4d20301f7c19545a.tar.gz
txr-b9e5782453ab8f89ac15219b4d20301f7c19545a.tar.bz2
txr-b9e5782453ab8f89ac15219b4d20301f7c19545a.zip
* arith.c (rising_product): Fix wrong m == n case,
which breaks the n_perm_k function for k == 1. * txr.1: Fix typo: n-choose-k written in place of n-perm-k.
-rw-r--r--ChangeLog7
-rw-r--r--arith.c2
-rw-r--r--txr.18
3 files changed, 12 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 8476aad0..a148c69c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2014-07-28 Kaz Kylheku <kaz@kylheku.com>
+
+ * arith.c (rising_product): Fix wrong m == n case,
+ which breaks the n_perm_k function for k == 1.
+
+ * txr.1: Fix typo: n-choose-k written in place of n-perm-k.
+
2014-07-27 Kaz Kylheku <kaz@kylheku.com>
Fix 2014-02-05 safety regression: unchecked use of non-function objects
diff --git a/arith.c b/arith.c
index 450ea641..c1f7026d 100644
--- a/arith.c
+++ b/arith.c
@@ -1983,7 +1983,7 @@ static val rising_product(val m, val n)
if (lt(n, one))
return one;
- if (ge(m, n))
+ if (gt(m, n))
return one;
if (lt(m, one))
diff --git a/txr.1 b/txr.1
index 238c5c4f..230d17c3 100644
--- a/txr.1
+++ b/txr.1
@@ -11109,7 +11109,7 @@ The n-choose-k function computes the binomial coefficient nCk which
expresses the number of combinations of <k> items that can be chosen from
a set of <n>, where combinations are subsets.
-The n-choose-k function computes nPk: the number of permutations of size <k>
+The n-perm-k function computes nPk: the number of permutations of size <k>
that can be drawn from a set of <n>, where permutations are sequences,
whose order is significant.
@@ -12584,7 +12584,7 @@ The iffi function defaults to the identity function when <else-func> is
omitted or nil, and therefore is useful in situations when one value is to be
replaced with another one when the condition is true, otherwise left alone.
-.SH Functions tf and nilf
+.SS Functions tf and nilf
.TP
Syntax:
@@ -12617,7 +12617,7 @@ If the argument (the divided value) passed into iff is even, then
iff passes it into the nilf function, which ignores the value and
returns nil.
-.SH Function retf
+.SS Function retf
.TP
Syntax:
@@ -12638,7 +12638,7 @@ Example:
;; the function returned by (retf 42) ignores 1 2 3 and returns 42.
(call (retf 42) 1 2 3) -> 42
-.SH Functions apf and ipf
+.SS Functions apf and ipf
.TP
Syntax: