Expression Calculator
The expression calculator parses what you type, applies the correct order of operations and shows each reduction. It supports +, −, ×, ÷, exponentiation with ^, modulo with %, parentheses, the constants pi and e, and the functions sqrt, cbrt, abs, sin, cos, tan, ln, log and exp.
Formula and method
PEMDAS/BODMAS: Parentheses → Exponents → Multiplication/Division (left-to-right) → Addition/Subtraction (left-to-right)
The parser tokenizes the input into numbers, operators, and function names, then applies the shunting-yard algorithm to convert infix notation to reverse Polish notation (RPN) respecting operator precedence. The RPN stack is then evaluated left-to-right to produce the numeric result.
Frequently asked questions
Which operators and functions are supported?
The four basic operations, modulo (%), exponentiation (^), parentheses, the constants pi and e, and the functions sqrt, cbrt, abs, sin, cos, tan, asin, acos, atan, ln, log and exp.
Does it follow order of operations?
Yes. Expressions are parsed with standard precedence, so 2 + 3 × 4 evaluates to 14, not 20.
Are angles in degrees or radians?
Trigonometric functions use radians. Use pi to write common angles, for example sin(pi/2).