In mathematics and computer programming, the order of operations is a collection of conventions about which arithmetic operations to perform first in order to evaluate a given mathematical expression.
These conventions are formalized with a ranking of the operations. The rank of an operation is called its precedence, and an operation with a higher precedence is performed before operations with lower precedence. Calculators generally perform operations with the same precedence from left to right, but some programming languages and calculators adopt different conventions.