Changeset 2518 in Sophya for trunk/SophyaLib/SysTools/cexpre.cc
- Timestamp:
- Mar 18, 2004, 7:15:19 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/SysTools/cexpre.cc
r2515 r2518 59 59 errmsg += s; 60 60 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); 67 64 } 68 65 } … … 173 170 else if (func == "atan") _f1 = atan; 174 171 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; 175 175 else if (func == "exp") _f1 = exp; 176 176 else if (func == "log") _f1 = log; 177 177 else if (func == "log10") _f1 = log10; 178 178 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; 179 183 else { 180 184 string errmsg = "CE_FuncExp::CE_FuncExp() - Uknown function " ;
Note:
See TracChangeset
for help on using the changeset viewer.