Evaluates a simple (does not contain functions) arithmetic expression.
The arithmetic expression to be evaluated.
The evaluated arithmetic expression.
auto result = eval("(5 + 3) * 2"); assert(result == "16"); auto expr = "3 * (4 + 2) / 3"; auto simplifiedExpr = eval(expr); assert(simplifiedExpr == "6");
See Implementation
Evaluates a simple (does not contain functions) arithmetic expression.