Very simple expression evaluator using shunting-yard algorithm and RPN (C++11).
// public api: evaluate string
double eval( const std::string &expr, std::string *err = 0 );
#include "eval.hpp"
int main() {
double var = eval("sin(11+12-13*(14)/15)"); // var == -0.991703
}
- v1.0.3 (2016/05/21): Fix name clash on OSX
- v1.0.2 (2016/05/19): Fix out-of-range iterator access
- v1.0.1 (2016/03/26): Add simple support for assignment and variables
- v1.0.0 (2016/02/20): Extra math stuff; Header-only now; Initial SemVer adherence;