Change language

Learn to calculate by playing with Online calculator

A short game to see where the result comes from. Pick a language and start; you can stop halfway and come back.

Loading the game…

← Back to Online calculator

What you will practise

Type the whole expression and get the result instantly, brackets and functions included.

How it works

Your text is turned into an operation tree before anything is computed. Brackets are resolved first, then powers, then multiplication and division, and finally addition and subtraction.

You can use constants (pi, e) and functions by typing their name followed by brackets: sqrt(16), abs(-5), round(2.7).

Formula

Operator precedence applied:

1. Brackets ( )
2. Functions and factorial !
3. Powers ^ (right-associative)
4. Multiplication *, division / and remainder %
5. Addition + and subtraction −

Worked example

Example 1: Expression: (15 + 7) * 3 / 2

1. Brackets: 15 + 7 = 22
2. Multiplication: 22 * 3 = 66
3. Division: 66 / 2 = 33

Result: 33

Example 2: Expression: 2 + 3^2 * (10 − 4) / 3

1. Brackets: 10 − 4 = 6
2. Power: 3^2 = 9
3. Multiplication and division, left to right: 9 * 6 = 54; 54 / 3 = 18
4. Addition: 2 + 18 = 20

Result: 20

How to play

First pick your language. Then work through the challenges one by one: each sets out a case with real numbers and, if you get stuck, you can ask for a hint. When you answer, you see whether you got it right and why. Progress is saved only in your browser, so you can stop halfway and carry on another day.