Scientific Calculator
Type an expression such as 2 * (3 + 4)^2, or use the keypad, and press Enter. The calculator handles trigonometry in degrees or radians, logarithms, powers, roots, factorials, π and e, and memory, with correct operator precedence. Every result goes into a history you can click to reuse, and errors are explained precisely.
Updated
How to use the Scientific Calculator
- 1Type an expression such as 2 * (3 + 4)^2 and press Enter, or use the keypad.
- 2Switch between degrees and radians for trigonometric functions.
- 3Use the memory keys to store and recall a running value.
- 4Click any line in the history to bring it back into the input.
How it works
The expression is parsed properly rather than evaluated as code. It is tokenised into numbers, operators and function names, converted to postfix notation with the shunting-yard algorithm — which handles operator precedence and right-associative powers correctly — and then evaluated from that stack.
That matters for safety as much as correctness. Passing user input to eval() would let arbitrary JavaScript run in the page; a dedicated parser can only ever produce a number or a clear error message.
Invalid input is reported precisely: unbalanced parentheses, an unknown function name, a missing operand, or a mathematically undefined result such as the logarithm of a negative number each get their own message rather than a generic failure.
Worked example
Evaluating a compound expression
- Type sin(30) with the mode set to degrees → 0.5
- Type 2^10 → 1024
- Type log(1000) + sqrt(144) → 3 + 12
Result: 15. Each result is added to the history, and can be clicked to reuse.
Tips and common mistakes
- Check the angle mode before using sin, cos or tan; degrees and radians give completely different answers.
- Use parentheses whenever you are unsure of the order; extra brackets never change a correct result.
- Click a line in the history to reuse it instead of retyping.
- Use the memory keys to keep a running total across several calculations.