GUIDE 05

Order of Operations: −2^2, the 6÷2(1+2) Debate and Calculator Rules

Precedence of brackets, postfix operators, powers, unary minus and multiplication, why -2^2 = -4 but Excel gives 4, right-associative powers, and how SciKey resolves 6÷2(1+2).

The same expression can give different results on different calculators. Almost always, the reason is how each one defines operator precedence. This guide lays out SciKey's full precedence table and looks closely at three expressions that regularly cause arguments: -2^2, 2^3^2 and 6÷2(1+2).

1. SciKey's precedence (highest first)

LevelOperationAssociativityExample
1Brackets, function calls(1+2), sin(30)
2Postfix ! % °Left to right5! = 120, 50% = 0.5
3Power ^Right to left2^3^2 = 512
4Unary - +-2^2 = −4
5×, ÷, mod, implied multiplicationLeft to right6÷2(1+2) = 9
6+, Left to right10−4−3 = 3

Operators on the same level follow their associativity: 8÷2÷2 is (8÷2)÷2 = 2 and 10−4−3 is (10−4)−3 = 3.

2. Why -2^2 is −4

In mathematics, −2² is read as −(2²) = −4: the power comes first and the minus sign applies to the result. It is the same rule that makes −x² = −4 when x = 2. SciKey ranks unary minus below exponentiation, so -2^2 returns −4. For (−2)², use brackets: (-2)^2 = 4.

A sign in the exponent is allowed: 2^-3 is 2⁻³ = 0.125.

Excel is different

In Microsoft Excel, =-2^2 returns 4. Microsoft's documentation, "Calculation operators and precedence in Excel", lists negation (the minus in −1) above percent (%) and exponentiation (^) in its precedence table, so Excel computes (−2)². If a spreadsheet and a calculator disagree, suspect this. In Excel, =-(2^2) gives −4.

Programming languages vary too. Python evaluates -2**2 as −4 (matching maths convention), while JavaScript considers -2**2 ambiguous and rejects it as a syntax error unless you add brackets.

3. Powers go right to left: 2^3^2 = 512

In mathematics, a tower like 2^3^2 means 2^(3²) = 2⁹ = 512, because the exponent of the exponent is evaluated first. SciKey treats ^ as right-associative, so 2^3^2 = 512. For (2³)² = 64, write (2^3)^2.

Excel's documentation says operators of equal precedence are evaluated left to right, and exponentiation is no exception, so =2^3^2 gives 64 there. Again, brackets make the intent unambiguous everywhere.

4. The 6÷2(1+2) debate

This one circulates online constantly, with camps insisting on 9 or 1.

  • Reading as 9: an implied multiplication is just a multiplication. 6÷2×3 = (6÷2)×3 = 9.
  • Reading as 1: 2(1+2) is a single unit, like 2a, so it goes first. 6÷(2×3) = 1.

The honest conclusion is not that one side is "wrong" but that the notation is ambiguous. Professional writing avoids it and uses a fraction bar or brackets instead.

SciKey's choice

SciKey gives implied multiplication the same precedence as ordinary multiplication and division and evaluates left to right. So:

  • 6÷2(1+2) = 9
  • 1/2π = (1/2)×π = 1.57079632679 (also shown as π/2)
  • For 1/(2π), type 1/(2π) = 0.159154943092

We chose this because a single rule is easier to predict: multiplication and division go in the order written, whether or not the sign is shown.

Other calculators

Some manufacturers and models are designed to evaluate a multiplication with an omitted sign before an ordinary × or ÷, so the same expression can give 1. Behaviour varies by model, so check your exam calculator's manual. The safest approach is never to type an ambiguous expression in the first place.

5. Postfix operators and %

!, % and ° apply only to the value immediately before them.

  • 3!2 = 3! × 2 = 12 (implied multiplication)
  • 2×3! = 12, while (2×3)! = 720
  • 200×15% = 200 × 0.15 = 30
  • 100+10% = 100 + 0.1 = 100.1

Watch the last one. Some desk calculators treat 100 + 10 % as "add 10% to 100" (= 110), but SciKey's % simply divides by 100. For a 10% markup, type 100×(1+10%) = 110.

6. mod precedence and sign

mod sits at the multiplication level: 2+7 mod 3 is 2 + (7 mod 3) = 3. The result takes the sign of the divisor: -7 mod 3 = 2 and 7 mod -3 = −2. In -7 mod 3, the unary minus binds to 7 first, because unary signs rank above the multiplication level.

7. Functions, constants and powers

Function calls have the highest precedence, so sin(30)^2 is (sin 30°)² = 0.25, the same as sin²30° in a textbook (DEG). For the sine of 30², put it inside: sin(30^2). Because SciKey requires brackets on functions, an ambiguous input like sin 30^2 is never accepted.

A power after a constant binds tighter than implied multiplication. 2π^2 is 2×(π²) = 19.7392088022, not (2π)² = 39.4784176044. That is also why the surface area of a sphere, 4πr², typed as 4πx^2 works as intended.

8. Remove ambiguity with brackets

More reliable than memorising rules is using brackets generously.

IntentAmbiguous inputClear input
a/(bc)a/bca/(b×c)
(−x)²-x^2(-x)^2
e^(−t/RC)e^-t/RCe^(-t/(R×C))
(a+b)/2a+b/2(a+b)/2

The letters a, b, t, R and C in the table are placeholders; in SciKey, substitute numbers or the x, y, z variables (note that R is already taken by the gas constant). The third row's e^-t/RC is evaluated as (e^−t)/RC. Whenever the exponent is an expression, bracket it. Extra brackets never make an answer wrong; missing ones often do.

9. Summary

  • Powers before unary minus: -2^2 = −4 (Excel gives 4)
  • Powers right to left: 2^3^2 = 512
  • ×, ÷ and implied multiplication share a level, left to right: 6÷2(1+2) = 9
  • % divides by 100: 100+10% = 100.1
  • When in doubt, add brackets

→ Open the calculator Function Reference

Last updated: 2026-09-24