From 2208314f4c8ab76381678bb8c1768ff33d69edcf Mon Sep 17 00:00:00 2001 From: Gennady Pospelov <g.pospelov@fz-juelich.de> Date: Fri, 7 Feb 2014 10:38:15 +0100 Subject: [PATCH] Changed way of parsing double in scientific notation due to problems under mac --- Core/Tools/src/Utils.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Core/Tools/src/Utils.cpp b/Core/Tools/src/Utils.cpp index ab1c6471df6..f221b62bf7a 100644 --- a/Core/Tools/src/Utils.cpp +++ b/Core/Tools/src/Utils.cpp @@ -20,6 +20,7 @@ #include <boost/regex.hpp> #include <boost/algorithm/string/replace.hpp> #include <boost/algorithm/string.hpp> +#include <string> #ifdef DEBUG_FPE #include <fenv.h> @@ -36,8 +37,10 @@ vdouble1d_t Utils::String::parse_doubles(const std::string& str) { vdouble1d_t buff_1d; std::istringstream iss(str); - double value; - while(iss >> value) buff_1d.push_back(value); + std::string svalue; + while(iss >> svalue) { + buff_1d.push_back(std::strtod(svalue.c_str(), NULL)); + } // std::copy(std::istream_iterator<double>(iss), // std::istream_iterator<double>(), back_inserter(buff_1d)); if( buff_1d.empty() ) { -- GitLab