Solve trig, log, power and factorial expressions with a full scientific keypad, DEG/RAD modes, memory keys, and calculation history. No eval() used.
Type sin(30)+sqrt(16)/2^2 into a spreadsheet cell or a search bar and you get autocomplete suggestions, not a number. Scientific Calculator reads the same kind of expression directly: a keypad for people who would rather tap than type, and a text field underneath it for people who would rather type than tap, both driving one hand-written parser so the two stay in sync.
Nothing here calls eval(). Every expression is tokenised and walked through a recursive-descent parser with the usual precedence: exponents before multiplication, multiplication before addition, and factorial or percent applied before any of it. Fixing the sample expression at 30 degrees gives sin of 30, which is 0.5, plus the square root of 16 divided by 2 squared, which is 1, for a result of 1.5.
sin() with the cursor already sitting between the parentheses, not after the closing one.2^3^2 reads as 2^(3^2)), then factorial and percent, then the innermost values.- on that number specifically, leaving the rest of the expression untouched.Division by zero is undefined. under the field before you even press =, since the live preview evaluates on every keystroke.Missing closing ")" — every "(" needs a matching partner.sqrt(-1) raises a domain error rather than returning a complex number, and asin or acos outside the range -1 to 1 does the same.170!, because 171! is the first factorial that overflows a JavaScript double to Infinity.