diff --git a/src/core/rational.cc b/src/core/rational.cc index 1e440765f2..2581f35f68 100644 --- a/src/core/rational.cc +++ b/src/core/rational.cc @@ -562,6 +562,9 @@ template <> Rational lexical_cast(const std::string &f) expsign = -1; ch = f[index++]; } + else if (ch == '+') { + ch = f[index++]; + } while (ch >= '0' && ch <= '9' && index <= length) { exponent *= 10; exponent += (ch - '0'); @@ -589,6 +592,9 @@ template <> Rational lexical_cast(const std::string &f) expsign = -1; ch = f[index++]; } + else if (ch == '+') { + ch = f[index++]; + } while (ch >= '0' && ch <= '9' && index <= length) { exponent *= 10; exponent += (ch - '0');