#include "pip.h"

void _() {
//! [main]
PIEvaluator eval;

eval.check("e2eelge");

piCout << eval.expression() << "=" << eval.evaluate();
// e*2*e*e*lg(e) = (17.4461; 0)

eval.check("10x");

piCout << eval.error() << eval.unknownVariables();
// Unknown variables: "x" {"x"}

eval.setVariable("x", complexd(1, 2));
eval.check("10x");

piCout << eval.error() << eval.unknownVariables();
// Correct {}

piCout << eval.expression() << "=" << eval.evaluate();
// 10*x = (10; 20)

eval.setVariable("x", complexd(-2, 0));

piCout << eval.expression() << "=" << eval.evaluate();
// 10*x = (-20; 0)
//! [main]
};
