Maths & numbers

Scientific expression calculator

Evaluate several lines of arithmetic with functions, variables and the previous answer.

Scientific expression calculator
Esc to restore

Your inputs

Operators + − × ÷ ^ % mod !, brackets, pi, e, ans, “name = value”, and functions such as sqrt, sin, ln, log(x, base), min, max, ncr, npr, gcd.

Results update as you type. Larger files run when you press Update result.

Your result

Your result will appear here.

More actions

Your inputs stay in this browser. Nothing is uploaded or saved.

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

First 5 rows of the example result
LineExpressionResult
12*(3+4)^2/sqrt(9)32.6666666667
2sin(30)0.5
3ans*21
4r = 5r = 5
5pi*r^278.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.