diff options
| author | dgp <dgp@users.sourceforge.net> | 2012-05-24 16:50:40 (GMT) |
|---|---|---|
| committer | dgp <dgp@users.sourceforge.net> | 2012-05-24 16:50:40 (GMT) |
| commit | 286580c577c4f54efd199d0996a7df88c02d01b4 (patch) | |
| tree | 4251a9956293cba5d933f821e66ea739b15f7dca /doc/expr.n | |
| parent | c8619c8ec837fc2b74af6a04df85b7c5646fae5d (diff) | |
| parent | dce46c947bd11b68d1979b9e708d177acfddb911 (diff) | |
| download | tcl-286580c577c4f54efd199d0996a7df88c02d01b4.zip tcl-286580c577c4f54efd199d0996a7df88c02d01b4.tar.gz tcl-286580c577c4f54efd199d0996a7df88c02d01b4.tar.bz2 | |
merge 8.5
Diffstat (limited to 'doc/expr.n')
| -rw-r--r-- | doc/expr.n | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -298,6 +298,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 @@ -308,11 +309,10 @@ is that produced by the \fB%g\fR format specifier of Tcl's \fBformat\fR command. For example, the commands .CS \fBexpr {"0x03" > "2"}\fR -\fBexpr {"0y" < "0x12"}\fR +\fBexpr {"0y" > "0x12"}\fR .CE 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 |
