#include "pip.h"

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

eval.check("2*sin(pi/2)");

piCout << eval.expression() << "=" << eval.evaluate().real();
// 2*sin(pi/2) = 2

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]
};
