diff options
Diffstat (limited to 'doc/expr.n')
-rw-r--r-- | doc/expr.n | 19 |
1 files changed, 11 insertions, 8 deletions
@@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: expr.n,v 1.16 2004/10/08 21:39:16 dkf Exp $ +'\" RCS: @(#) $Id: expr.n,v 1.17 2004/10/26 10:24:59 dkf Exp $ '\" .so man.macros .TH expr n 8.5 Tcl "Tcl Built-In Commands" @@ -51,9 +51,10 @@ ways accepted by an ANSI-compliant C compiler (except that the \fBf\fR, \fBF\fR, \fBl\fR, and \fBL\fR suffixes will not be permitted in most installations). For example, all of the following are valid floating-point numbers: 2.1, 3., 6e4, 7.91e+16. -If no numeric interpretation is possible, then an operand is left -as a string (and only a limited set of operators may be applied to -it). +If no numeric interpretation is possible (note that all literal +operands that are not numeric or boolean must be quoted with either +braces or with double quotes), then an operand is left as a string +(and only a limited set of operators may be applied to it). .PP On 32-bit systems, integer values MAX_INT (0x7FFFFFFF) and MIN_INT (-0x80000000) will be represented as 32-bit values, and integer values @@ -64,22 +65,24 @@ Operands may be specified in any of the following ways: .IP [1] As a numeric value, either integer or floating-point. .IP [2] +As a boolean value, using any form understood by \fBstring is boolean\fR. +.IP [3] As a Tcl variable, using standard \fB$\fR notation. The variable's value will be used as the operand. -.IP [3] +.IP [4] As a string enclosed in double-quotes. The expression parser will perform backslash, variable, and command substitutions on the information between the quotes, and use the resulting value as the operand -.IP [4] +.IP [5] As a string enclosed in braces. The characters between the open brace and matching close brace will be used as the operand without any substitutions. -.IP [5] +.IP [6] As a Tcl command enclosed in brackets. The command will be executed and its result will be used as the operand. -.IP [6] +.IP [7] As a mathematical function whose arguments have any of the above forms for operands, such as \fBsin($x)\fR. See below for a list of defined functions. |