Order of operations on a calculator: why -3^2 is -9, and degrees vs radians

How a scientific calculator reads an expression: brackets, powers, the leading minus, implicit multiplication, degrees vs radians, nCr and nPr.

Open the Scientific calculator Free, in your browser, nothing uploaded.

Two people type the same keys into two calculators and get different answers. Usually neither calculator is broken: one of them read the expression in a different order, or was set to radians instead of degrees. This guide explains how a scientific calculator decides what to work out first, what the angle setting does, and how counting functions like nCr work, so you can trust the number on the screen. The fibub scientific calculator reads a whole line at once and follows the rules below. To change units before you calculate, use the engineering unit converter; to solve for an unknown instead of working out a value, try the equation solver; and for grids of numbers, the matrix calculator.

What it is

An expression is read in a fixed order of precedence, from first to last:

  1. Brackets: anything inside ( ) is worked out first.
  2. Powers and factorials: 4^2, 5!. Powers stack from the right, so 2^3^2 means 2^(3^2) = 2^9 = 512.
  3. A leading minus: −3^2 means −(3^2), which is −9. To square −3, write (−3)^2.
  4. Multiplication and division, left to right. Writing two things side by side, like 2π or 2(1+2), multiplies them at this same level.
  5. Addition and subtraction, left to right.

Percent (%) divides the number before it by 100, so 200 × 15% is 30.

Angles can be measured in degrees (a full turn is 360°) or radians (a full turn is 2π, about 6.283). sin, cos and tan read their input in the chosen unit, and the inverse functions answer in it. The same key, cos(60), gives 0.5 in degrees and about −0.952 in radians, because 60 radians is nearly ten full turns.

Factorial n! multiplies every whole number from 1 to n. nPr, permutations, counts ordered picks of r from n: n! ÷ (n − r)!. nCr, combinations, counts unordered picks: n! ÷ (r! (n − r)!).

How to use it

  1. Type an expression in the box, or tap the keys. The answer appears under it as you type.
  2. Choose Degrees or Radians before any trig.
  3. Press = or Enter to save the line to History; tap a past line to bring it back.
  4. Use Ans for the last answer, and M+, M−, MR and MC to keep a running number.
  5. Type constant names such as c, h or NA, or use ×10ˣ (or 1.5e3) for scientific notation. Copy result copies the number.

A worked example

A student works through a physics and maths sheet:

  • 2 + 3 × 4^2: power first (16), then 3 × 16 = 48, then 2 + 48 = 50.
  • −3^2 gives −9; (−3)^2 gives 9.
  • 2^3^2 gives 512, not 64.
  • 6 ÷ 2(1 + 2): implicit multiplication sits with ÷ and ×, read left to right, so 6 ÷ 2 = 3, then 3 × 3 = 9.
  • In degrees, sin(45) = 0.707106781187 and asin(0.5) = 30. In radians, asin(0.5) = 0.523598775598, which is π ÷ 6.
  • A committee of 3 from 10 people: nCr(10, 3) = 120. A president, secretary and treasurer from 10: nPr(10, 3) = 720, six times as many because each group of 3 can be ordered 3! = 6 ways.
  • Frequency of light with a 500 nm wavelength: c ÷ (500e-9) = 5.99584916 × 10^14 Hz.
  • 0.1 + 0.2 shows 0.3, because results are rounded to 12 significant digits.

Checked with the tools

Each line above was run through the calculator’s own parser (evaluate() and show() in src/lib/everyday/sciparse.ts) with Node, in the stated angle mode. It returned exactly the values shown: 50, −9, 9, 512, 9, 0.707106781187, 30, 0.523598775598, 120, 720, 599584916000000 and 0.3. It also refused tan(90) in degrees and 1 ÷ 0 with a message, and capped factorials at 170!.

Where it is used

  • School and exams. Trig, logs and combinations in maths, physics and chemistry homework.
  • Science and engineering. Quick sums with physical constants, such as frequency from wavelength or energy from a photon count.
  • Statistics and probability. nCr and factorials for counting outcomes, as in lottery-style odds or committee picks.
  • Finance students. Powers and roots for growth rates before moving to a dedicated finance tool.
  • Programming. Checking what a formula should give before writing it in code, where precedence rules are similar.

Common mistakes

  • Forgetting the angle mode. If sin(30) does not give 0.5, you are in radians.
  • Squaring a negative without brackets. −3^2 is −9; write (−3)^2 for 9.
  • Typing ÷ for a long fraction. 1 ÷ 2 × 3 is 1.5, not 1/6. Put the bottom in brackets: 1 ÷ (2 × 3).
  • Expecting a value where none exists. tan(90°), ln(0) and 1 ÷ 0 have no answer, so the calculator says so.
  • Mixing up nPr and nCr. If order matters (first, second, third), use nPr.

Questions people ask

Is 6 ÷ 2(1+2) really 9? On this calculator, yes, because it treats implicit multiplication like ×. Some calculators give 1, because they bind 2(1+2) more tightly. Brackets remove the doubt.

Why does it show 12 digits? Computers store numbers in binary, so tiny errors like 0.30000000000000004 appear. Rounding to 12 digits hides that noise.

How big a factorial can it do? Up to 170!, about 7.26 × 10^306. 171! is too big for standard numbers.

Sources

  • Order of operations: brackets, then powers and factorials, then multiplication and division, then addition and subtraction, with a leading minus applied after the power (so -2^2 = -4), as in standard mathematical convention.
  • Constants are the exact SI values fixed in 2019 for the speed of light, Planck constant, Boltzmann constant, Avogadro constant and elementary charge, plus standard gravity 9.80665 m/s2, G = 6.6743e-11 and R = 8.314462618 (NIST, physics.nist.gov/cuu/Constants, checked 2026-12-05).
  • nPr = n!/(n-r)! and nCr = n!/(r!(n-r)!). Results are shown to 12 significant digits.

If you are an author or publisher and want a credit or a passage changed or removed, tell us and we will act quickly.

Tools in this article

Read next