A scientific expression calculator without dynamic code execution
This calculator parses mathematical expressions using an explicit grammar instead of passing your input to eval() or another dynamic JavaScript execution mechanism. That makes the supported syntax predictable and keeps the calculator’s behavior constrained to mathematical operations.
Operator order
parentheses → postfix ! and % → powers ^ → × and ÷ → + and −Powers are right-associative, so 2^3^2 is interpreted as 2^(3^2). Unary plus and minus are supported, and scientific notation such as 1.2e6 can be entered directly.
Trigonometry and angle modes
Choose Degrees for common classroom and practical angle measurements or Radians for calculus and higher mathematics. Inverse trigonometric functions return an angle in the currently selected mode.
Worked examples
Enter sin(30)^2 + cos(30)^2 in degree mode to verify the trigonometric identity and get approximately 1. Enter sqrt(81) + log(100) to get 11. Enter 5! to calculate 120.
Precision and limitations
Calculations use JavaScript’s IEEE 754 double-precision numbers. This is appropriate for everyday scientific calculation but can show familiar floating-point rounding effects. Factorials are limited to 170, and the tool is not an arbitrary-precision computer algebra system.
Frequently asked questions
Does the scientific calculator use JavaScript eval()?
No. Expressions are parsed by a first-party recursive-descent parser with explicit operators, constants and supported functions. Dynamic code execution is not used.
Which trigonometric functions are supported?
The calculator supports sin, cos, tan, asin, acos and atan. You can switch the angle mode between degrees and radians.
What constants and functions can I type?
Supported constants include pi, e and ans. Functions include sqrt, abs, ln, log, exp, floor, ceil, round and the trigonometric functions listed above.
How does the percent symbol work?
A postfix percent sign divides the preceding value by 100. For example, 50% evaluates to 0.5.
What is the largest factorial supported?
Factorial is limited to non-negative integers from 0 through 170 because larger factorials exceed the finite numeric range used by the browser.