diff options
| author | donal.k.fellows@manchester.ac.uk <dkf> | 2012-05-17 17:26:34 (GMT) |
|---|---|---|
| committer | donal.k.fellows@manchester.ac.uk <dkf> | 2012-05-17 17:26:34 (GMT) |
| commit | 29be4dc486f58e54e5a293e5991b72d8f4730c2a (patch) | |
| tree | ee4effddf5b644872a5b9d6a19146045fc5a5736 /doc/expr.n | |
| parent | 59701c929b1481b48f11c3a9f198f6262ac97029 (diff) | |
| parent | ad772c6f12654aa8f02347c035f849164c15287a (diff) | |
| download | tcl-29be4dc486f58e54e5a293e5991b72d8f4730c2a.zip tcl-29be4dc486f58e54e5a293e5991b72d8f4730c2a.tar.gz tcl-29be4dc486f58e54e5a293e5991b72d8f4730c2a.tar.bz2 | |
merge trunk
Diffstat (limited to 'doc/expr.n')
| -rw-r--r-- | doc/expr.n | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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 |
