This project is a scientific calculator designed to handle both simple arithmetic and complex mathematical functions, including logarithms, trigonometric operations, and solving linear equations. It supports calculations in both infix and postfix (Reverse Polish Notation, RPN) notations and is capable of understanding constants like Pi and Euler's number (e).
- Infix and Postfix Notation: Perform calculations using both standard and RPN formats.
- Mathematical Functions: Supports addition, subtraction, multiplication, division, logarithms (log, ln), and trigonometric functions (sin, cos, tan, ctan).
- Constants Recognition: Automatically recognizes and calculates expressions involving Pi and e.
- Equation Solving: Can solve simple linear equations with one variable.
- Error Handling: Gracefully handles errors, providing meaningful feedback to the user.
cargo runcargo testTo generate and view the documentation for this project, use the following Cargo commands:
# Generate documentation
cargo doc
# Generate documentation and open it in your browser
cargo doc --openHere are a few examples of how to use the calculator:
(3+(4-1))*5➜302 * x + 0.5 = 1➜x=0.252 9 +➜112 9 + 2 *➜22log(10)➜1log10➜1sin(pi)➜0sin(pi) + ln(e)➜1sinpi➜0sin(1.5pi)➜-1sin(1.5*pi)➜-1pi➜3.141592652pi➜6.28318531e➜2.71828183log100(10)➜0.5