Skip to content

Order of Operations

//"Please excuse my dear Aunt Sally" —Anonymous//

To figure out order of operations, the calculator divides all the operations into 15 priority levels. When evaluating an expression, everything on one priority level is simplified (usually, going from left to right) before moving on to the next.

Of course, everything inside parentheses, brackets, and braces is simplified first.

Priority Level
Operations on that level

1
Everything inside parentheses ( ), brackets [ ], and braces { }

2
Indirection (#)1

3
Function calls: everything with its own parenthesis, e.g. 68k:sin()

4
Operators that go after their operand, e.g. T
This also includes taking elements from lists and matrices with [ ]

5
Exponentiation (^, .^)2

6
Negation (-)

7
String concatenation (&)

8
Multiplication and division (*, /, .*, ./)

9
Addition and Subtraction (+, -, .+, .-)

10
Equality relations: (=, , >, , <, )

11
Logical and arithmetic 68k:not 3

12
Logical and arithmetic 68k:and

13
Logical and arithmetic 68k:or, 68k:xor

14
Constraint "68k:with" operator (|)

15
Store ()

[[footnoteblock]]


  1. Note that this means #x[n] will take the nth element of #x, not # of x[n] 

  2. Unlike other priority levels, this one is evaluated right to left. For instance, x^y^z is interpreted as x^(y^z) not (x^y)^z. 

  3. This order may seem unintuitive when and, or, xor, not are arithmetic operations. For instance, not 5+6 will be not(5+6) as opposed to not(5)+6. 

Authors: KG