Operator associativity
Operator associativity is used primarily in computer science , but also mathematics and logic :
 in the narrower sense, the property of an operator that the order in which several occurrences of the operator are evaluated in an expression has no influence on the final result, i.e. the associative law applies to this operator ;
 in a broader sense, the definition of how an operator that is not associative in the narrower sense should be evaluated.
For example, in mathematics, addition and normal multiplication in the narrower sense are associative operators, i.e. or , as well as matrix multiplication, and in logic, conjunction and disjunction .
In the case of operators that are not associative in the narrower sense , on the other hand, the result depends on the operator associativity defined by convention in the broader sense : In order to avoid that expressions with adjacent, equivalent operators without parentheses are ambiguous, it is determined whether the operators concerned are from left to are to be evaluated right or vice versa from right to left.
Left associative operators
A leftassociative operator is evaluated from left to right  a binary operator is therefore considered to be leftassociative if the expressions
Etc.
are to be evaluated as shown. Examples of leftassociative operations are:


However: In the case of horizontal fraction lines, the shorter fraction line binds more strongly:  
Legal associative operators
Conversely, a rightassociative operator is evaluated from right to left, so that:
Etc.
Examples of rightassociative operations are:
 The exponentiation : because it would be easy . Attention: calculator cost inputs the shape however usually leftassociative, so look as if they in the form were entered  in terms of this form therefore are rightpotentiating must always through its own Parentheses are enforced: .
x ^ y ^ z
(x ^ y) ^ z
x ^ (y ^ z)
 The subjunction in logic is used by most authors rechtssassoziativ, which means that as we read.
 The assignment operator of some programming languages , such as C :,
x = y = z
is synonymous withx = (y = z)
, that is, the value ofy
is firstz
assigned to the variable and only then is the result of this assignment (i.e. the assigned valuez
)x
assigned to the variable .
Side effects in programming languages
In programming languages that allow side effects in expressions, the order in which these side effects are performed / effective is important. Some programming languages strictly define this evaluation sequence, others (such as C or C ++ ) leave the evaluation sequence undefined for most of the Infix operands. Example:
int f1(void);
int f2(void);
int f3(void);
int g(int);
int h(void) {
return g( f1()  f2()  f3() );
}

It is not defined whether to run first f1 , f2 or f3 (and for its side effects to take effect).

See also
Individual evidence
 ^ Order of operations . (PDF) Rochester Institute of Technology
 ^ The Order of Operations. Education Place
 ^ The Order of Operations . Khan Academy ( video, from 05:40 am )
 ^ Using Order of Operations and Exploring Properties . (PDF) Section 9 Virginia Department of Education
 ↑ Precedence rules and associativity . Chemnitz University of Technology
 ^ Rules for Exponents and the Reasons for Them . (PDF) Western Michigan University