Operator Precedence

The precedence of an operator specifies how “tightly” it binds two expressions together. For example, in the expression 1 + 5 * 3, the answer is 16 and not 18 because the multiplication (“*”) operator has a higher precedence than the addition (“+”) operator. Parentheses may be used to force precedence, if necessary. For instance: (1 + 5) * 3 evaluates to 18.

The following table lists the precedence of operators with the lowest-precedence operators listed first.

ChaosPro trans Precedence
Associativity Operators
ChaosPro trans Precedence
left  , 
ChaosPro trans Precedence
left  = (assignment)
ChaosPro trans Precedence
left  || (logical or) 
ChaosPro trans Precedence
left  && (logical and)
ChaosPro trans Precedence
non-associative   == (equal to) 
ChaosPro trans Precedence
non-associative   != (not equal to) 
ChaosPro trans Precedence
non-associative  < (lower than) 
ChaosPro trans Precedence
non-associative  <= (lower or equal) 
ChaosPro trans Precedence
non-associative  > (greater than) 
ChaosPro trans Precedence
non-associative  >= (greater or equal) 
ChaosPro trans Precedence
left  + (addition) 
ChaosPro trans Precedence
left  - (subtraction) 
ChaosPro trans Precedence
left  * (multiplication) 
ChaosPro trans Precedence
left  / (division) 
ChaosPro trans Precedence
left   % (modulo) 
ChaosPro trans Precedence
left  ^ (power) 
ChaosPro trans Precedence
right  ! (logical not) 
ChaosPro trans Precedence
right  - (negation) 
ChaosPro trans Precedence
right  [ (array dimension) 
ChaosPro trans Precedence

Precedence