- added a new ex constructor ex(string, ex) instead; use as follows:
symbol x("x"), y("y");
ex e("Pi*(4*x^2+y)^10", lst(x, y));
or, for interactive input:
symbol x("x");
string s;
cout << "Input something (may contain 'x'): ";
getline(cin, s);
try {
e = ex(s, lst(x));
cout << "You entered " << e << endl;
cout << "e.diff(x) = " << e.diff(x) << endl;
} catch (exception &c) {
cerr << c.what() << endl;
}
- symbols not specified in the list in the second argument to ex(string, ex)
but encountered in the input expression will throw an exception