Fixed #891 (false positive: division by zero)

This commit is contained in:
Daniel Marjamäki 2009-11-15 19:07:36 +01:00
parent 5616a9569e
commit 95c898f37b
1 changed files with 4 additions and 1 deletions

View File

@ -51,7 +51,10 @@ double MathLib::toDoubleNumber(const std::string &str)
{
return std::strtoul(str.c_str(), '\0', 16);
}
return std::atof(str.c_str());
std::istringstream istr(str.c_str());
double ret;
istr >> ret;
return ret;
}
template <typename T>