summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2012-05-17 17:26:34 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2012-05-17 17:26:34 (GMT)
commit9c37cb89b43bf41494ec861b25260fc42c4349ce (patch)
treeee4effddf5b644872a5b9d6a19146045fc5a5736 /doc
parent51d852e99981583fe62a25ea4e141238f7ed16c2 (diff)
parent6e977b903ee0e35f5b799abe1c8b3c902a5b5cef (diff)
downloadtcl-9c37cb89b43bf41494ec861b25260fc42c4349ce.zip
tcl-9c37cb89b43bf41494ec861b25260fc42c4349ce.tar.gz
tcl-9c37cb89b43bf41494ec861b25260fc42c4349ce.tar.bz2
merge trunk
Diffstat (limited to 'doc')
-rw-r--r--doc/expr.n6
1 files changed, 3 insertions, 3 deletions
diff --git a/doc/expr.n b/doc/expr.n
index 2ecd501..7b29f81 100644
--- a/doc/expr.n
+++ b/doc/expr.n
@@ -326,6 +326,7 @@ returns \fB4.0\fR, not \fB4\fR.
String values may be used as operands of the comparison operators,
although the expression evaluator tries to do comparisons as integer
or floating-point when it can,
+i.e., when all arguments to the operator allow numeric interpretations,
except in the case of the \fBeq\fR and \fBne\fR operators.
If one of the operands of a comparison is a string and the other
has a numeric value, a canonical string representation of the numeric
@@ -337,12 +338,11 @@ is that produced by the \fB%g\fR format specifier of Tcl's
.PP
.CS
\fBexpr\fR {"0x03" > "2"}
-\fBexpr\fR {"0y" < "0x12"}
+\fBexpr\fR {"0y" > "0x12"}
.CE
.PP
both return 1. The first comparison is done using integer
-comparison, and the second is done using string comparison after
-the second operand is converted to the string \fB18\fR.
+comparison, and the second is done using string comparison.
Because of Tcl's tendency to treat values as numbers whenever
possible, it is not generally a good idea to use operators like \fB==\fR
when you really want string comparison and the values of the