Scientific Calculator: Order of Operations, Trig Modes and Precision
By FindMySum · Last reviewed
A scientific calculator does more than add and multiply. It reads a whole expression at once, applies the order of operations, and adds the functions that school and work maths rely on: powers and roots, logarithms, trigonometry, factorials and the constants π and e. This article explains how the calculator reads what you type, the two angle modes, the log and ln buttons, and the precision behind each answer, using the calculator's default expression as a worked example.
Order of operations
An expression such as 2^10 + sqrt(144) / 3 - sin(30) is not worked out left to right. The calculator builds a tree from it using the standard precedence rules, from highest to lowest:
| Priority | Operation | Example |
|---|---|---|
| 1 | Brackets and function calls | sqrt(144), (1 + 2) |
| 2 | Factorial | 5! = 120, 2^3! = 2^6 = 64 |
| 3 | Powers, right to left | 2^3^2 = 2^9 = 512 |
| 4 | Unary minus | -2^2 = −4 |
| 5 | Percent | 50% = 0.5, 2^10% = 10.24; straight after + or −, a percentage of the number before it: 100 + 10% = 110 |
| 6 | Multiplication, division, remainder, left to right (implied multiplication too) | 12 / 3 * 2 = 8, 6/2(1+2) = 9 |
| 7 | Addition and subtraction, left to right | 10 - 4 + 1 = 7 |
Two rows trip people up. Powers group from the right, so a tower of exponents is evaluated from the top down, which is the convention in algebra textbooks. And a leading minus sign applies after the power: -2^2 means −(2²) = −4. Spreadsheets disagree here; Excel evaluates -2^2 as 4 because it applies the sign first. If you mean the square of negative two, type (-2)^2.
The calculator also understands implied multiplication, so 2pi is 2 × π and 3(4 + 1) is 15. In the "how it's calculated" panel you can see the expression rewritten with every multiplication made explicit, which is the quickest way to check that it was read the way you intended.
Worked example: the default expression
The calculator opens with 2^10 + sqrt(144) / 3 - sin(30) in degree mode. Following the table:
- Function calls first: sqrt(144) = 12 and sin(30°) = 0.5.
- The power: 2^10 = 1024.
- Division: 12 / 3 = 4.
- Addition and subtraction from left to right: 1024 + 4 − 0.5 = 1027.5.
Switch the angle unit to radians and only one step changes: sin(30) now means the sine of 30 radians, about −0.988, so the result becomes roughly 1028.988. That one switch is behind most "my calculator is wrong" moments in trigonometry homework.
Degrees and radians
A full turn is 360 degrees or 2π radians, so one degree is π/180 radians, the exact factor given in the NIST Guide to the SI. Degrees are natural for geometry, navigation and construction. Radians are the unit in which calculus works: the derivative of sin x is cos x only when x is in radians, and formulas for arc length, angular velocity and oscillations assume radians.
In degree mode the calculator multiplies the angle by π/180 before taking sin, cos or tan, and the inverse functions multiply their answer by 180/π. Exact multiples of 90° are treated exactly, so sin 180° is 0 and tan 90° is reported as undefined, rather than a tiny or enormous number left over from rounding π. In radian mode, results smaller than 10⁻⁵⁰ from sin, cos or tan of an ordinary angle are treated as zero for the same reason: sin(pi) would otherwise show about 3 × 10⁻⁶⁴.
log, ln and other bases
Hand-held calculators label two logarithm keys, and this calculator follows them. log is the common logarithm, base 10, so log(1000) = 3. ln is the natural logarithm, base e, so ln(e) = 1. Any other base can be written with a second argument, log(x, b), which the calculator evaluates as ln(x) ÷ ln(b): log(8, 2) = 3. The NIST Digital Library of Mathematical Functions defines all three in its chapter on elementary functions, along with the identities that connect them.
Logarithms are defined only for positive numbers, so log(0) and ln(-5) are reported as errors. The same applies to the square root of a negative number and to sin⁻¹ or cos⁻¹ of a value outside the range −1 to 1: they have no real-number answer, and the calculator does not switch to complex numbers.
Precision: why 0.1 + 0.2 is 0.3 here
Most software stores numbers in binary floating point, which cannot represent 0.1 exactly. That is why a browser console reports 0.1 + 0.2 as 0.30000000000000004. This calculator evaluates every step in decimal arithmetic with 64 significant digits, through the BigNumber mode of the math.js library, and rounds only the final answer to 15 significant digits. Decimal inputs therefore stay exact, and irrational results such as √2 = 1.4142135623731 are correct to every digit shown. The 32-digit view is there when you need to compare against a table or check a rounding boundary.
Factorials are computed exactly up to 1000!, a number with 2,568 digits, and shown in scientific notation once they pass about 21 digits. Fractional factorials such as 3.5! need the gamma function, which is not included.
Typing expressions quickly
The keypad is there for touch screens, but the expression box accepts everything from a physical keyboard. Use * for ×, / for ÷ and ^ for powers. Pasted symbols ×, ÷, −, π and √ are converted automatically. Press Enter to add the current result to the history list and Escape to clear the box. Because every change is written to the page address, Share produces a link that opens the same expression in the same angle mode for whoever receives it.
More questions
Why does my phone calculator give a different answer for 6 ÷ 2(1 + 2)?
Because the expression is ambiguous and calculators resolve it differently. This calculator treats implied multiplication like an ordinary ×, working left to right with division, so 6 ÷ 2(1 + 2) = 6 ÷ 2 × 3 = 9. Some older hand-held models give implied multiplication a higher priority and return 1. Mathematicians avoid the question by writing 6 ÷ (2(1 + 2)) or (6 ÷ 2)(1 + 2), and you should too whenever an answer matters.
How do I enter a number in scientific notation?
Type the mantissa, the letter e and the exponent with no spaces: 6.022e23 is 6.022 × 10²³ and 1.6e-19 is 1.6 × 10⁻¹⁹. Be careful not to confuse this with the constant e: 2e3 is 2000, while 2 * e^3 is about 40.17. Very large and very small answers are shown the same way, so 100! appears as 9.33262154439442e+157.
How do I take a root other than a square or cube root?
Use nthRoot(x, n) or a fractional power. The fourth root of 81 is nthRoot(81, 4) or 81^(1/4), both 3. Put the fraction in brackets: 81^1/4 means (81^1) ÷ 4 = 20.25. nthRoot also handles odd roots of negative numbers, so nthRoot(-27, 3) is −3, while (-27)^(1/3) is reported as not a real number.
Can I convert between degrees and radians with this calculator?
Yes, with the conversion factor. Degrees to radians is x × pi / 180, so 45 * pi / 180 = 0.785398163397448. Radians to degrees is x × 180 / pi, so 1 * 180 / pi = 57.2957795130823. The angle-unit switch does not change these lines, because no trig function is involved; it only changes how sin, cos and tan and their inverses read and return angles.
What is the difference between sin⁻¹ and 1/sin?
sin⁻¹(x), written asin(x), is the inverse function: the angle whose sine is x, so asin(0.5) is 30° in degree mode. 1/sin(x) is the reciprocal, called the cosecant, so 1/sin(30) is 2. The superscript −1 means inverse function here, not a power, which is a frequent mix-up in homework.
Does the calculator remember my previous answers?
Pressing = or Enter adds the expression and its result to a history list for the current visit; select an entry to load it again. The list is not saved anywhere and disappears when you leave the page. To keep a calculation, use Share: the link holds the expression and the angle unit, so opening it later reproduces the result.
Sources
This article explains how the calculator works and is general information, not financial, tax, legal or medical advice. Rules change; check the sources above or a qualified professional before you act.