Scientific Calculator
Result
Result
- Fully parenthesized
- (sin(30) + ((2 ^ 3) * sqrt(16)))
A scientific calculator is only as good as the order it reads things in, so this page gives you both halves: the value, and the expression with every bracket made explicit. 2 + 3 * 4 is 14, because the multiplication goes first, while (2 + 3) * 4 is 20. Powers are right-associative, so 2^3^2 is 2^(3^2) = 512, and a power binds tighter than a leading minus, so -2^2 is -4. Trigonometry follows the angle mode you choose: sin(30) is 0.5 in degrees and -0.988032 in radians, from the same expression.
sin(30) + 2^3 * sqrt(16), worked out step by step
| Step | Worked out | In degrees | In radians |
|---|---|---|---|
| 1 | sin(30) | 0.5 | -0.988032 |
| 2 | 2 ^ 3 | 8 | 8 |
| 3 | sqrt(16) | 4 | 4 |
| 4 | 2 ^ 3 * sqrt(16) | 32 | 32 |
| 5 | sin(30) + 2 ^ 3 * sqrt(16) | 32.5 | 31.011968 |
The order the calculator actually works in: innermost and leftmost first, so the three functions and the power are all resolved before either operator. Reading the second column downwards is also a reading of the precedence rules — sin(30), then 2 ^ 3, then sqrt(16), then the product of those last two, then the sum. The two right-hand columns are the angle mode side by side: only the rows containing a trigonometric function differ between them, which is the whole of what the mode does. Row 2 and row 3 are identical in both columns for that reason, and row 4 is identical because it is built from them. Everything in the table is a number, so it reads the same in all ten languages.
Formula
precedence, loosest first: + - then * / then unary - and √ then ^ (right-associative) trigonometry is read in the selected angle mode, and asin, acos and atan hand their answer back in that same mode
- ^
- The power operator, and the tightest binding of all: 2^3 * 4 squares 2 first, so it is 8 * 4 = 32. It is also the one operator that groups to the right, which is why 2^3^2 means 2^(3^2) and not (2^3)^2 — 512 rather than 64.
- √
- The square root, written √16 or sqrt(16) — both are accepted and both come back printed as sqrt(16). The cube root cbrt is the one that accepts a negative: cbrt(-27) is -3, while sqrt(-4) has no real answer.
- sin cos tan
- The three trigonometric functions. Their argument is an angle, read in the angle mode you picked — the same characters sin(30) mean 0.5 in degrees and -0.988032 in radians. asin, acos and atan run the other way and return their answer in that same mode.
- deg / rad
- The angle mode. It changes nothing except the trigonometric functions: every other operator, and every expression with no trigonometry in it, gives the same number either way. It is the single most common reason a correct-looking calculation comes out wrong.
- ( )
- Parentheses, which override the precedence above. Adding them is also the only way to see the grouping: the second output rewrites the whole expression with parentheses around every operation, so (2 + (3 * 4)) and ((2 + 3) * 4) can be compared at a glance.
Use it for the arithmetic that comes up between the other calculators on this site: a powers and roots calculation, a trigonometric value in one specific angle mode, or a compound expression you would otherwise have to break into steps and hope you kept the order of operations straight. The bracketed reading is there for the moment a result surprises you — nine times out of ten it is not the arithmetic that was wrong but the grouping.
Worked examples
sin(30) + 2^3 * sqrt(16), in degrees
- Read the precedence: the whole expression is a sum, and its right-hand side is a product
- sin(30) with the angle mode set to degrees is 0.5
- 2^3 = 8 — the power goes before the multiplication it sits in
- sqrt(16) = 4
- 8 * 4 = 32
- 0.5 + 32 = 32.5
The bracketed reading is what to look at first: (sin(30) + ((2 ^ 3) * sqrt(16))). It says the addition happens last and that the multiplication owns both of the pieces to its right. Switch the angle mode to radians and nothing changes except the first step — sin(30) becomes -0.988032 and the answer becomes 31.011968.
(2 + 3) * 4, where the parentheses are the whole point
- The parentheses come first: 2 + 3 = 5
- Then the multiplication: 5 * 4 = 20
- Without the parentheses the reading would be (2 + (3 * 4)) = 14
Two characters change the answer by six. This is the pair worth entering side by side: the bracketed output for (2 + 3) * 4 is ((2 + 3) * 4) and for 2 + 3 * 4 it is (2 + (3 * 4)) — the two readings differ in exactly one position, and that position is where the answer comes from.
sin(pi/2), in radians
- pi is the constant 3.141592653589793, so pi/2 is 1.5707963267948966
- The angle mode is radians, so that number is the angle as it stands
- sin of a quarter turn is 1
The same quarter turn reads as 90 in degrees. The angle mode is not a display preference — it decides what number the function is handed, and sin(90) in radians would be 0.893997, since 90 radians is about fourteen quarter turns and a bit.
Limitations
One expression, and it has to be arithmetic. There are no variables, so x + 1 cannot be entered, and nothing is simplified symbolically: (x + 1)(x + 2) is foil-calculator's job, and solving for a variable is quadratic-formula-calculator's. Answers are decimal only — six places on the result, with very large and very small magnitudes shown as a mantissa times a power of ten — because a scientific calculator's answer here is a number, not an exact form; √72 comes back as 8.485281 rather than 6√2 (that is radical-calculator). The accepted functions are sin, cos, tan, asin, acos, atan, sqrt, cbrt, ln, log, log2, exp and abs, with the constants pi and e. The multiplication sign cannot be left out: 2pi, 2(3+4) and 2e3 are all rejected rather than guessed at, and a function name must be followed by a bracket, so sin 30 is not accepted. Expressions are capped at 80 characters, 48 operations and a literal of one million. Results must be finite: dividing by zero, taking the log of zero or a negative number, the square root of a negative number, and the tangent of 90 degrees are reported as a failed calculation rather than as infinity, and are not flagged on the input box — they are values that do not exist, not spellings that are wrong.
Frequently asked questions
- In what order does it evaluate the expression?
- Powers first, then unary minus and roots, then multiplication and division, then addition and subtraction, with parentheses overriding all of it. Within one level the operators group from the left, except powers, which group from the right. So 6 / 3 * 2 is 4 rather than 1, and 2^3^2 is 512 rather than 64.
- Degrees or radians — which should I pick?
- Whichever the problem is written in, and the answer changes completely if you pick wrong: sin(30) is 0.5 in degrees and -0.988032 in radians. If an expression has no trigonometry in it, the mode makes no difference at all — the reference table on this page shows both columns so you can see exactly which steps it touches.
- Why is 2pi rejected when the multiplication is obvious?
- Because it is only obvious to a human. 2e3 is the counter-example: it could be read as a scientific-notation literal or as 2 times the constant e times 3, and the two readings differ by a factor of about a thousand. Rather than pick one and be silently wrong for half the people typing it, this page requires the sign: write 2 * pi.
- Why does a negative square root fail instead of giving an answer?
- Because no real number squares to a negative one. sqrt(-4) has no value on the real line, so the calculation is reported as failed, with the reason kept in the browser console for anyone who wants the detail. cbrt does accept negatives, since an odd root of a negative number is a perfectly good negative number: cbrt(-27) is -3.
- What does the fully parenthesized output add?
- It is the expression as the calculator read it, with a bracket around every single operation. Reading (sin(30) + ((2 ^ 3) * sqrt(16))) tells you three things at once that the original line only implies: the addition is last, the power belongs to the multiplication, and the square root is a separate factor. When an answer looks wrong, that line is usually where the mistake turns out to be.
- How exact is the answer?
- It is a decimal, rounded to six places, so sin(30) comes back as 0.5 and 1/3 as 0.333333. Very large and very small results switch to a mantissa and a power of ten, so 2^100 is shown as 1.267651 × 10^30 rather than as thirty-one digits. If you need the exact form of a root, radical-calculator and square-root-calculator keep it.
References
- Order of operations — the precedence and associativity rules this page's bracketed reading makes visible — Wolfram MathWorld (United States)
- Trigonometric functions — the six functions this page accepts, and the angle their argument stands for — Wolfram MathWorld (United States)
- Radian — the other unit an angle can be written in, which is what the angle mode switches between — Wolfram MathWorld (United States)