summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2012-03-29 22:53:35 -0700
committerKaz Kylheku <kaz@kylheku.com>2012-03-29 22:53:35 -0700
commit5f26f2f8baaf377e414660df4e71afce9c4f4f48 (patch)
tree738831f689670ed89a983b0fcb7d272241b10781 /txr.1
parent8b8ca2e793f90aa58d7430b8f060c467cd41ec1b (diff)
downloadtxr-5f26f2f8baaf377e414660df4e71afce9c4f4f48.tar.gz
txr-5f26f2f8baaf377e414660df4e71afce9c4f4f48.tar.bz2
txr-5f26f2f8baaf377e414660df4e71afce9c4f4f48.zip
* lib.c (min2, max2): Semantics tweak. If the numbers are equal,
favor the left one. * txr.1: Documented min and max.
Diffstat (limited to 'txr.1')
-rw-r--r--txr.125
1 files changed, 25 insertions, 0 deletions
diff --git a/txr.1 b/txr.1
index d104df86..13724a41 100644
--- a/txr.1
+++ b/txr.1
@@ -7087,6 +7087,31 @@ character will convert to integer.
.SS Functions max and min
+.TP
+Syntax:
+
+ (max <number> <number>*)
+ (min <number> <number>*)
+
+.TP
+Description:
+
+The max and min functions determine and return the highest or lowest
+value from among their arguments.
+
+The arguments must be numbers or characters.
+
+If only a single argument is given, that value is returned.
+
+If two arguments are given, then (max a b) is equivalent to (if (>= a b) a b),
+and (min a b) is equivalent to (if (<= a b) a b). If the operands do not
+have the same type, then one of them is converted to the type of the other;
+however, the original unconverted values are returned. For instance
+(max 4 3.0) yields the integer 4, not 4.0.
+
+If three or more arguments are given, max and min are left-associative.
+Thus (max a b c) is (max (max a b) c).
+
.SS Functions search-regex and match-regex
.SS Function regsub