Scientific Calculator
Expression calculator with powers, factorials, trig, logs, DEG/RAD, Ans memory and batch evaluation
三个约定:「%」就是把数字除以 100,所以 200×10% = 20,要「涨 10%」请写 200*(1+10%);相邻的量会自动相乘,2pi、3(4+1)、(2)(3) 都能算;函数括号可省,sin30 等同于 sin(30)。数字里的千分位逗号可用,如 1,000/8。
批量计算沿用 ① 里的角度单位与保留位数设置;Ans 在批量模式下取上一次单条计算的结果。每行必须是完整表达式,不能只写运算符。
About this tool
A basic calculator cannot evaluate 12!/(5!*7!), and running eval on user input is not acceptable. This tool tokenises the expression, converts it to postfix and evaluates it, so you get exactly what you typed, with every rule stated:
- Full expressions: arithmetic, parentheses, powers, factorials, percentages and remainders can be mixed;
2+3*4is 14,(2+3)*4is 20 and(2+3)*sqrt(16)/2^3is 2.5 - Scientific and engineering forms:
1e3+1is 1001,2E-2is 0.02 and1,000,000/8/7understands thousands separators and gives 17857.1428571 - Optional parentheses and multiplication signs:
2piis 6.28318530718,3(4+1)is 15,sin30equalssin(30),√9is 3 and∛(-27)is -3 - DEG and RAD: in degrees
sin(30)is 0.5 andacos(0.5)is 60; in radianssin(30)is -0.988031624093, and inverse trig output follows the mode - Several views of the result: grouped form, full double-precision value, scientific notation, integer part, decimal places, three rounding modes and a reduced fraction approximation
- Ans and memory: Ans recalls the last result, MS stores, MR recalls and MC clears; continuing from the previous answer is one click
- History: the last 20 expressions and results, and clicking one loads it back for editing
- Batch evaluation: one expression per line; a bad line does not stop the others and its error is shown beside it
- Explained errors: unclosed parentheses report how many closing brackets are missing, and
1/0,√-4,ln(0),tan(90),171!and(-8)^0.5each get a specific message
When to use it
- Write a long calculation in one line, such as a combination, a geometric series sum or a compound interest total that chained key presses cannot handle
- Check a formula by hand and verify it without precedence mistakes
- Evaluate a pasted column of expressions from a spreadsheet or notes
- Teach right-associative powers, the precedence of unary minus and roots, and the difference between degrees and radians
- Engineering and statistics with hyperbolic functions, base-2 logs, remainders and factorials
Supported syntax
| Input | Meaning | Result |
|---|---|---|
| 2+3*4 | Multiplication first | 14 |
| 2^10 and 2**10 | Power, both spellings | 1024 |
| 2^3^2 | Right-associative, so 3^2 first | 512, not 64 |
| -2^2 | Power binds tighter than unary minus | -4; write (-2)^2 for 4 |
| 5! and fact(5) | Factorial | 120 |
| 10% and 200*(1+10%) | Percent means divide by 100 | 0.1 and 220 |
| 100 mod 7 | Remainder | 2 |
| 12!/(5!*7!) | Combination written directly | 792 |
| 3(4+1), 2pi, (2)(3) | Adjacent values multiply | 15, 6.28318530718, 6 |
| 1,000/8 | Thousands separator | 125 |
| sin30 + 1 | A function without brackets takes only the next value | 1.5, not sin(31) |
| ans*2 | Recall the last result | 42 when the last answer was 21 |
Precedence, highest first
- Parentheses
( ): the direct way to change precedence; unclosed brackets report how many are missing - Postfix
!%: bound to the preceding value, so2^3!is 2^6 = 64 - Power
^: right-associative and tighter than unary minus - Unary signs
-3+5: can repeat, so3 - -2is 5 - Multiply, divide, remainder
*/mod: includes implicit multiplication and is left-associative - Add and subtract
+-: lowest, left-associative, so100-20-30is 50
Functions and constants
| Group | Names | Checked example |
|---|---|---|
| Trig and inverse trig | sin cos tan asin acos atan | DEG: cos(60)+sin(30) = 1, asin(0.5) = 30 |
| Hyperbolic | sinh cosh tanh | cosh(0) = 1, sinh(0) = 0 |
| Powers and roots | ^ ** sqrt √ cbrt ∛ | 9^(1/2) = 3, sqrt(144)+3^2 = 21 |
| Logs and exponentials | ln log lg log10 log2 exp | log(1000)+ln(e) = 4, log2(1024) = 10 |
| Rounding and sign | abs round floor ceil sign | round(2.5)+floor(2.5)+ceil(2.5) = 8 |
| Factorial and remainder | ! fact mod | 5!+3! = 126, 10 mod 3 = 1 |
| Angle conversion | degrees radians | degrees(pi/3) = 60, radians(180) = pi |
| Constants | pi π e phi φ tau | π = 3.14159265359, e = 2.71828182846, φ = 1.61803398875, tau = 6.28318530718 |
Common questions
- Why is
-2^2equal to -4?In mathematics minus x squared means the negative of x squared, so the power goes first. Use(-2)^2for 4. The same rule makes2^3^2equal 512 rather than 64 - Why does the result show 0.3 while the raw value is 0.30000000000000004?That is the inherent representation error of double-precision floating point. Automatic mode rounds to 12 significant figures to hide the noise;
sqrt(2)*sqrt(8)shows 4 while the raw value is 4.000000000000001 for the same reason. Check the raw value row to see the real error - Degrees or radians?Degrees by default, so
sin(30)is 0.5. In radians 30 means 30 radians andsin(30)is -0.988031624093. Inverse trig output follows the mode, soacos(0.5)is 60 in degrees. Thedegreesandradiansfunctions ignore the switch and always convert by the radian definition - Why is
sin(pi)not zero?The result is1.224647e-16. Pi can only be stored approximately, and the rate of change of sine near pi is about -1, so input error becomes output error almost unchanged. Test against a tolerance instead of expecting an exact integer - How large a factorial can it handle?170! is
7.257416e+306, close to the double limit of about 1.8e308, and 171! reports overflow. Fractional and negative factorials are not supported because they need the Gamma function and complex numbers. Integer ratios such as12!/(5!*7!)= 792 cancel safely before overflow - What does the percent sign mean?Divide by 100:
10%is 0.1 and200*10%is 20. For a 10 percent increase write200*(1+10%)= 220. A monthly 10 percent rise over a year totals(1+10%)^12-1= 2.13842837672, or 213.84 percent - Does it execute the code I type?No. The input is tokenised, implicit multiplication is inserted, a shunting-yard pass produces postfix, and that is evaluated step by step. There is no
evaland no dynamic function construction; letters are only accepted as registered function names and constants, and anything else is rejected with a position - What is not supported?Multi-argument functions (use
log2(8)orlog(8)/log(2)), variables and user-defined functions, complex numbers and infinity symbols, and summation or product notation.1e3is read as 1000, so write1*e*3for 1 times e times 3
Related tools: use the fraction calculator to turn a result back into an exact fraction, the percentage calculator for shares and changes, the compound interest calculator to expand a final value into a year-by-year table, and the unit converter for units. Expressions and results stay in the browser and are never uploaded.