- ~ ! | unary minus, bitwise NOT, logical NOT |
* / % | multiply, divide, remainder |
+ - | add, subtract |
| bitwise shift left, bitwise shift right |
= = | boolean comparisons |
== != | boolean equals, not equals |
& | bitwise AND |
${}^wedge$ | bitwise exclusive OR |
| bitwise inclusive OR |
&& | logical AND |
\ | logical OR |
x ? y : z | if x != 0, then y, else z
|
All operators support integers. All support floating point except ~,
\%, ltlt, gtgt, &, ${}^wedge$, and . Boolean operators can
also be used for string operands, in which case string comparison will
be used. This will occur if any of the operands are not valid
numbers. The &&, \, and ?: operators have ``lazy evaluation``,
as in C.
Possible operands are numeric values, Tcl variables (with $),
strings in double quotes or braces, Tcl comands in brackets, and
the following math functions:
{ t