BeeeOn Gateway
v2020.3.1-2-g6f737dc
Platform to interconnect the IoT world
|
#include <SimpleCalc.h>
Public Member Functions | |
double | evaluate (const std::string &input) const |
Very simple evaluator of math expressions. It performs operations with left-associativity. Thus, there is no operator precedence applicated. Examples:
y = 2 + 5 * 1 - 3 / 2 * 5 -> 7 * 1 - 3 / 2 * 5 -> 7 - 3 / 2 * 5 -> 4 / 2 * 5 -> 2 * 5 -> 10