This is my first Rust project. It is a calculator with a custom parser. The goal of this project is for me to learn a bit of Rust and to get familiar with its syntax.
To run the program, simply clone the repo and run cargo tauri dev inside of the folder.
I created the parsing with the help of this article: https://www.engr.mun.ca/~theo/Misc/exp_parsing.htm
S -> E end
E -> T {("+" | "-") T}
T -> F {("*" | "/") F}
F -> P | P "^" F
P -> (v | "(" E ")" | "-" T | {P "!"})
end expression has to be reached
- S = start
- E = expression
- P = primary
- T = term
- F = factor
- v = constant (a floating point number for now)
The frontend part is implemented using Tauri and pure html/js/css. The desing is heavily inspired by windows calculator.
- error handling
- racional results
- negative numbers (unary operators)
- float
- float input
- support for
**operator - functions (abs, sin, cos...)
- postfix operators (factorial, ...)
- write test cases
- roots
- fractions
- history
- exponential number notation (*10^n)
- constants (pi, e, ...)
Calculator icon by Icons8
