A very basic math expressions(infix) evaluator
This library built using basic RPN
algorithm and intended to evaluate infix
math expressions.
In simple words it evaluates expressions like this:
( 5 - 3 ) * 2
into
4
git clone git@github.com:b37t1td/libcalc.git
cd libcalc
take build
cmake ..
cpack
sudo dpkg -i libcalc_*.deb
Example of test.cxx
#include <iostream>
#include <libcalc.hpp>
int main() {
std::cout << libcalc::eval("2 * ( 5 - 3 )") << std::endl;
}
Which we build with:
g++ -std=c++11 -Wall test.cxx `pkg-config --libs --cflags libcalc`
So, run it ./a.out
and you will see 4
.
MIT