summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorferrieux <ferrieux@users.sourceforge.net>2012-12-09 19:44:57 (GMT)
committerferrieux <ferrieux@users.sourceforge.net>2012-12-09 19:44:57 (GMT)
commita68a31f4bff004ca60d9cf17cb74a9fc8b94d2ed (patch)
treec9d7568c23ebf2c173439852d55f089fa2cb4c15
parentff12195b2b7d3b9d0f8f4441bd3ec0c991ba742b (diff)
downloadtcl-a68a31f4bff004ca60d9cf17cb74a9fc8b94d2ed.zip
tcl-a68a31f4bff004ca60d9cf17cb74a9fc8b94d2ed.tar.gz
tcl-a68a31f4bff004ca60d9cf17cb74a9fc8b94d2ed.tar.bz2
[Bug 3594188] Clarifications about commas.
-rw-r--r--ChangeLog1
-rw-r--r--doc/expr.n16
2 files changed, 15 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index aeb6a62..9c42929 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@
* tests/chan.test: Clean up unwanted eofchar side-effect of
chan-4.6 leading to a spurious "'" at end of chan.test under
certain conditions (see [Bug 3389289] and [Bug 3389251]).
+ * doc/expr.n: [Bug 3594188] Clarifications about commas.
2012-12-08 Alexandre Ferrieux <ferrieux@users.sourceforge.net>
* generic/tclIO.c: Fix busyloop at exit under TCL_FINALIZE_ON_EXIT
diff --git a/doc/expr.n b/doc/expr.n
index 6d965fb..8698f5c 100644
--- a/doc/expr.n
+++ b/doc/expr.n
@@ -39,9 +39,9 @@ additional operators not found in C.
.SS OPERANDS
.PP
A Tcl expression consists of a combination of operands, operators,
-and parentheses.
+parentheses and commas.
White space may be used between the operands and operators and
-parentheses; it is ignored by the expression's instructions.
+parentheses (or commas); it is ignored by the expression's instructions.
Where possible, operands are interpreted as integer values.
Integer values may be specified in decimal (the normal case), in binary
(if the first two characters of the operand are \fB0b\fR), in octal
@@ -283,6 +283,18 @@ rules for resolving functions in namespaces. Either
current]::tcl::mathfunc::sin\fR will satisfy the request, and others
may as well (depending on the current \fBnamespace path\fR setting).
.PP
+Some mathematical functions have several arguments, separated by commas like in C. Thus:
+.PP
+.CS
+\fBexpr\fR {hypot($x,$y)}
+.CE
+.PP
+ends up as
+.PP
+.CS
+tcl::mathfunc::hypot $x $y
+.CE
+.PP
See the \fBmathfunc\fR(n) manual page for the math functions that are
available by default.
.SS "TYPES, OVERFLOW, AND PRECISION"