A console application for mathematical calculations using parsing. Created for educational purposes.
> 2 + 2 * 2
= 6
> x=4, y=2, (x+y)^x
= 4, 2, 1296
> x=sin(pi*5), y=2tg(e), x+y - (x * y)
= 6.1232339957367663e-16, -0.90109906813961538, -0.90109906813961416
> 3+3+3^3-pi+e
= 32.576689174869252
> x
^
Expected assignment at: 2
> (3+3
^
Expected brace at: 5
> sin3
= 0.14112000805986721
> sin(3+4
^
Expected brace at: 8
> e
= 2.7182818284590451
> e / 0
^
Division by zero at: 5
> 2^2^2^2
= 256
Statement
Statement ,
Command
Expression
Undefined variable =
Expression
Variable =
Expression
Term
Term +
Expression
Term -
Expression
Primary
Primary Variable
Term (
Expression )
Term sin
Primary
Term cos
Primary
Term tg
Primary
Term ctg
Primary
Term sec
Primary
Term cosec
Primary
Term *
Primary
Term /
Primary
Term %
Primary
Term ^
Primary
Number
Variable
(
Expression )
sin
Primary
cos
Primary
tg
Primary
ctg
Primary
sec
Primary
cosec
Primary
-
Primary
+
Primary
A floating point number.
A text that starts with a letter and can contain letters, numbers, or _
.