A CLI math expression calculator written in C
In 1.1 version you can calculate math expressions, declare variables and use commands.
The calculator has 3 command modes, starting with an input expression.
-
Execute commands like listvar, listcommands, clear, and more.
-
Declare variables with expressions like
var_name=math expression -
Calculate math expressions like
(124 / 4) * $piThe result is saved in $s special var
The operators supported are:
+ - * / ^
Only parentheses ( ) are supported.
>> (23 - 67)*(343)
-15092.00
>> $pi * 3
9.42
>> love=100
>> listvar
-------------------------------
| Variables List |
-------------------------------
love -> 100.00
$s -> 9.42
$pi -> 3.14
>> listcommands
-------------------------------
| Commands List |
-------------------------------
listcommands -> List the registered commands
listvar -> List the registered variables
clear -> Clear the CLI
exit -> Exit the program
Just clone this repository and run the build on ./bin/ according your OS.
If you want compile your own build run:
$ make && make run
or
$ gcc ./apps/MathCalculator ./src/* -I ./include -o ./bin/YourMathCalculatorBuild