MENU
Operators
The operators, in order of precedence, are:
No. | Operator | Description | Associativity |
1 | () | bracket grouping | NA |
2 | [] () .++, -- |
array subscript function call selectorincrement,decrement |
L-R |
3 | +- ! | unary | R-L |
4 | * / | multiplicative | L-R |
5 | + - | additive | L-R |
6 | <><= >= | relational | L-R |
7 | == != | equality | L-R |
8 | && | Logical and | L-R |
9 | ^^ | Logical exclusive or | L-R |
10 | || | Logical inclusive or | L-R |
11 | ?: | Ternary selection | L-R |
12 | = += -= *= /= | Assignment | L-R |
13 | , | Sequence | L-R |
Examples | |||
m=f*m; // component-wise | |||
v=f*v; // component-wise | |||
v=v*v; // component-wise | |||
m=m*m; // linear algebraic | |||
v=v*m; // linear algebraic | |||
v=m*v; // linear algebraic | |||
f=dot(v,v); // vector dot product | |||
v=cross(v,v); // vector cross product | |||
m=matrixCompMult(m,m); // component-wise |