Scientific Calculator
A scientific calculator with trig, log, and memory functions.
๐ Runs entirely in your browser โ nothing is uploaded.
How Scientific Calculator works
How does the scientific calculator evaluate what I type?
Instead of calling eval(), it uses a hand-written recursive-descent parser that walks your expression character by character, respecting order of operations and parentheses, and evaluates functions like sin, cos, tan, log, ln, and sqrt along the way. The ^ operator is right-associative for exponents, and constants pi and e are recognized directly in the input.
When would I use this over a phone's built-in calculator?
It's meant for calculations a basic four-function calculator can't do, like evaluating sqrt(144) + sin(30) or a nested expression with several parentheses in one go. The memory keys (M+, M-, MR, MC) also make it easier to chain a running total across several separate calculations.
Are the trig functions in degrees or radians, and what does the % key actually do?
Trig input is treated as degrees, not radians โ so sin(30) gives 0.5, not the radian-based result. The % button is not a percentage operator; it performs a standard modulo (remainder) operation between two numbers, so 10 % 3 evaluates to 1 rather than converting 10 to a percentage.