MCPcopy Create free account
hub / github.com/BYVoid/OpenCC / ParsePositiveDouble

Function ParsePositiveDouble

plugins/jieba/src/JiebaSegmentation.cpp:143–154  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141}
142
143bool ParsePositiveDouble(const std::string& text, double* value) {
144 if (text.empty()) {
145 return false;
146 }
147 char* end = nullptr;
148 const double parsed = std::strtod(text.c_str(), &end);
149 if (end == text.c_str() || *end != '\0' || parsed <= 0.0) {
150 return false;
151 }
152 *value = parsed;
153 return true;
154}
155
156bool ParseNonNegativeDouble(const std::string& text, double* value) {
157 if (text.empty()) {

Callers 1

LoadMergedJiebaDictFunction · 0.85

Calls 1

emptyMethod · 0.45

Tested by

no test coverage detected