We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 74dbb9a commit a84f60aCopy full SHA for a84f60a
src/main.cpp
@@ -97,7 +97,10 @@ static int fc_int(const std::string& s) {
97
return val;
98
}
99
static double fc_double(const std::string& s) {
100
- return std::stod(s);
+ size_t pos;
101
+ double val = std::stod(s, &pos);
102
+ if (pos != s.size()) throw std::invalid_argument("trailing characters in double: " + s);
103
+ return val;
104
105
static const std::string& fc_string(const std::string& s) { return s; }
106
0 commit comments