11#include "CLHEP/Evaluator/Evaluator.h"
20 eval.setVariable(
" dummy ", 0.);
21 assert(
eval.findVariable(
" dummy ") );
25 eval.setSystemOfUnits();
26 std::cout.precision(15);
28 std::cout <<
"CALC> ";
33 std::cin.get(exp, 240);
35 if ( !std::cin || strcmp(exp,
"exit") == 0 || strcmp(exp,
"quit") == 0) {
36 std::cout << std::endl;
39 double value =
eval.evaluate(exp);
40 switch(
eval.status()) {
42 std::cout << value << std::endl;
47 std::cout <<
"------";
48 for (
int i=0; i<
eval.error_position(); i++) std::cout <<
"-";
49 std::cout <<
"^" << std::endl;
52 std::cout << std::endl;
double eval(std::string expr, int &numbad, std::ofstream &os)