Scientific expression calculator
Evaluate several lines of arithmetic with functions, variables and the previous answer.
A clear answer. Here’s how.
A small parser reads each line with the usual order of operations: brackets, factorial and percent, powers (right to left, so 2^3^2 = 512), unary minus (so −2^2 = −4), multiplication, division and mod, then addition and subtraction. Implicit multiplication such as 2(3+4) or 2pi works. “ans” is the previous result, and “name = value” stores a variable. Arithmetic uses double-precision floating point, shown to 12 significant digits. Nothing is evaluated as code.
See a worked example
Worked example
A fixed demonstration, separate from the values you enter above.
- Expressions, one per line
2*(3+4)^2/sqrt(9) sin(30) ans*2 r = 5 pi*r^2 20%*85 ncr(52,5) 5!
- Angle unit for trigonometry
- Degrees
Example result
| Line | Expression | Result |
|---|---|---|
| 1 | 2*(3+4)^2/sqrt(9) | 32.6666666667 |
| 2 | sin(30) | 0.5 |
| 3 | ans*2 | 1 |
| 4 | r = 5 | r = 5 |
| 5 | pi*r^2 | 78.5398163397 |
Angles are in degrees. Order of operations: brackets, factorial and %, powers (right to left, so 2^3^2 = 512), unary minus (so −2^2 = −4), multiplication/division/mod, then addition/subtraction. “ans” is the last result and “name = value” stores a variable. Results are shown to 12 significant digits and use ordinary floating point.