MCPcopy Create free account
hub / github.com/chen3feng/toft / ParseFloatNumber

Function ParseFloatNumber

base/string/number.cpp:193–214  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

191
192template <typename T>
193bool ParseFloatNumber(const char* str, T* value, char** endptr)
194{
195 char* tmp_endptr;
196 if (endptr == NULL) // Allow NULL endptr
197 endptr = &tmp_endptr;
198
199 int old_errno = errno;
200 errno = 0;
201 *value = StringToFloat<T>::Convert(str, endptr);
202
203 if (errno != 0)
204 return false;
205
206 if (*endptr == str)
207 {
208 errno = EINVAL;
209 return false;
210 }
211
212 errno = old_errno;
213 return true;
214}
215
216} // namespace
217

Callers 1

ParseNumberFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected