Changeset 2518 in Sophya for trunk/SophyaLib/SysTools/cexpre.cc


Ignore:
Timestamp:
Mar 18, 2004, 7:15:19 PM (22 years ago)
Author:
ansari
Message:

Suite (presque finie) des modifications de l'interpreteur - gestion des variables en particulier - Reste au moins un bug ds CExpressionEvaluator - Reza 18/03/2004

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/SysTools/cexpre.cc

    r2515 r2518  
    5959    errmsg += s;
    6060   
    61     if ((s == "+") || (s == "-"))  throw CExprException(errmsg);
    62     for(int k=0; k<l; k++) {
    63       if ((!isdigit(s[k])) && !((k==0) && (s[k] != '+') || (s[k] != '-')) )
    64         throw CExprException(errmsg);
    65     }
    66     _val = atof(s.c_str());
     61    char* lcc;
     62    _val = strtod(s.c_str(), &lcc);
     63    if (*lcc != '\0')  throw CExprException(errmsg);
    6764  }
    6865}
     
    173170  else if (func == "atan") _f1 = atan;
    174171  else if (func == "atan2") _f2 = atan2;
     172  else if (func == "sqrt") _f1 = sqrt;
     173  else if (func == "fabs") _f1 = fabs;
     174  else if (func == "floor") _f1 = floor;
    175175  else if (func == "exp") _f1 = exp;
    176176  else if (func == "log") _f1 = log;
    177177  else if (func == "log10") _f1 = log10;
    178178  else if (func == "pow") _f2 = pow;
     179  else if (func == "hypot") _f2 = hypot;
     180  else if (func == "sinh") _f1 = sinh;
     181  else if (func == "cosh") _f1 = cosh;
     182  else if (func == "tanh") _f1 = tanh;
    179183  else {
    180184    string errmsg = "CE_FuncExp::CE_FuncExp() - Uknown function " ;
Note: See TracChangeset for help on using the changeset viewer.