Previous Topic | Table of Contents | Next Topic

Expression Operators

In order of decreasing precedence:

Operator
Meaning
( ) Grouping or Procedure call arguments
{ } Run the enclosed statement list and return 1 if it succeeds or 0 otherwise.
[ ] Array indexing. (The first element is element 0.)
-A   -C   -D   -H   -R   -S   -d   -e   -f   -o   -w   -x   -z
File system tests
++    -- Prefix and postfix increment/decrement
~   -   !   + Bitwise, arithmetic and logical complements and unary plus
** Exponentiation
*   /   %   // Multiplication, Division, Remainder and Integer Division
+   - Addition and Subtraction
<<   >> Bit-Shifting
==   !=   =~   !~   <   <=   >=   > Relation-testing and pattern-matching operators
& Bit And
^ Bit Xor
| Bit Or
&& Logical And
|| Logical Or
?: Conditional selection
=   +=   -=   *=   /=   %=   //=   >>=   <<=   &=   ^=   |=   **=
Assignment operators

Expressions result in sensible types, considering both the types and the values of the operands. For example, 10/2 returns the integer 5 but 5/2 produces the floating point value 2.5. Also, the integer 1, the floating point value 1.0 and the string "1" all compare equal.



Previous Topic | Table of Contents | Next Topic

Copyright © 1988-2003 by Hamilton Laboratories. All rights reserved.