A command-line calculator in C++
- Boost version 1.71.0
- MacOS - install with brew
brew install boost
- Ubuntu - install with apt
sudo apt update sudo apt install libboost-all-dev
- CMake version 3.10+
mkdir build
cd build
cmake ..
cmake --build .
cd ..
./bin/computorv2
- Commands
- list_variables - list all the assigned variables
- list_functions - list all the assigned variables
- exit - exit the program
- Expression evaluation
expression = ?
- Polynomial solver
expression = expression ?
- Variable assignation
Grammar
Examples
variable = expression
Warning:x = 42 y = x^2 + 2x + 1
- If the variable is already assigned, this command will reassign it with the new value;
- Function assignation
function_name(parameter) = expression
- list_variables and list_functions
- history
- function composition
- parenthesis multiplication
- matrix can contain expression