expreval provides an API to evaluate constant expressions
clone the repo, include "include/expreval.h" and compile "src/expreval.cpp" in your project to run tests git submodule update --init --recursive --remote and call make test
| symbol | meaning |
|---|---|
+ |
Addition |
- |
Subtraction |
* |
Multiplication |
/ |
Division |
^ |
Exponentiation |
call the evaluate function providing a well formed string as the expression
float result = expreval::evaluate("2+3*(-5+10)"); // 17