Two operators cannot be written consecutively. The operands must be such that the operations are mathematically defined, e.g. dividing by zero, raising zero to a negative or zero power, or raising a negative number to a real power are all illegal. An arithmetic expression is evaluated by replacing variable operands and parenthesised expressions by their values, and performing the operations indicated in sequence, using the result of each operation as an operand of the next. The sequence of operations is determined by the following precedence order, in which operators on any line have equal precedence and precedence decreases downwards. A variable operand, or a parenthesised expression, is evaluated before the following rules are applied.
Exponentiation is performed from right to left.
All other operations are performed from left to right unless the operator precedence rules stipulate the opposite. It is usually best to avoid dividing one integer by another unless there are special reasons for doing so.