How the expression is parsed
A single text field takes an expression, with a Degrees or Radians choice beneath it and a grid of buttons for digits, operators and functions. The page tokenises the string, converts it to reverse Polish notation with a shunting-yard pass, and evaluates it on a stack. Pressing Enter or the equals button runs the same path, and the blue panel shows either the answer or the word Error with the reason.
A worked example
The field starts as sin(30)^2 + cos(30)^2 with Degrees selected, so the tool turns 30 degrees into radians before each call. Sine of 30 is a half and cosine of 30 is root three over two, and their squares sum to exactly one, so the panel reads 1 and the note says Evaluated in degrees.
The operators and functions on offer
It handles addition, subtraction, multiplication, division and power with the caret, unary minus, parentheses, and an implied multiply so 2pi or 3(4+1) work. The factorial mark needs a non-negative whole number and refuses anything past 170. The percent mark is postfix divide-by-100, not a remainder operator. Named functions are sin, cos, tan, asin, acos, atan, sqrt or the radical sign, cbrt, ln, log as base ten, abs and exp, alongside the constants pi and e.
Where it stops
- Function names must be lowercase, so typing SIN fails with an Unexpected S message.
- There is no memory or answer recall, only one live line.
- Percent divides by 100, which is surprising next to the operator keys and never performs modulo.
- Output rounds to ten decimal places and flips to scientific notation past very large or tiny magnitudes.
Questions people ask
Why is my factorial erroring?
Factorials here accept only whole numbers up to 170; anything larger would overflow, so the page reports Factorial overflow past 170.
Do the trig functions use degrees?
Only when Degrees is selected. The note under the answer always repeats which mode produced the number.
Percentage Calculator, Quadratic Equation Solver and Permutation Combination Calculator build on the same math.