Operators work like functions; however, their notation is different.
The following is a list of all available operators and their order of execution in any statement (priority). Following the table of operators shown below are detailed descriptions of each operator, including their usage and examples.
If you require further information on operators in statements or operator priority, please see Operators in Statements, and Operator Priority in Statements.
Note: When doing comparisons between two operands of different types, the second operand is always cast to the type of the first. This can cause differing comparison results depending on the order of the operands.
|
Description |
Symbol |
Priority |
|
Parentheses |
( ) |
1 |
|
Scope Resolution |
\ |
2 |
|
Array Index |
[ ] |
3 |
|
@ |
4 | |
|
~ or ! |
5 | |
|
- |
5 | |
|
* |
5 | |
|
& |
5 | |
|
++ |
5 | |
|
-- |
5 | |
|
* |
6 | |
|
/ |
6 | |
|
% |
6 | |
|
+ |
7 | |
|
- |
7 | |
|
>> |
8 | |
|
<< |
8 | |
|
< |
9 | |
|
Less Than or Equal To |
<= or =< |
9 |
|
> |
9 | |
|
Greater Than or Equal To |
>= or => |
9 |
|
Equal To |
== |
10 |
|
Not Equal To |
<> or >< or != |
10 |
|
^ |
11 | |
|
& or && |
12 | |
|
| or || |
13 | |
|
? : |
14 | |
|
Assignment |
= |
15 |
|
Add Equals |
+= |
15 |
|
Subtract Equals |
-= |
15 |
|
Multiply Equal |
*= |
15 |
|
Divide Equals |
/= |
15 |
|
Modulus Equals |
%= |
15 |
Topics in this section: