#include <iostream>
#include "uCalc.h"

using namespace std;
using namespace uCalcSoftware;

int main() {
   uCalc uc;
   // By default, invalid operations return 'nan'
   cout << uc.EvalStr("sqrt(-1)") << endl;

   // Enable error raising for this specific case
   uc.Error().TrapOnInvalid(true);

   // Now, the same operation returns a descriptive error message
   cout << uc.EvalStr("sqrt(-1)") << endl;
}