MCPcopy Create free account
hub / github.com/Oneflow-Inc/oneflow / StringToFloat

Function StringToFloat

oneflow/core/common/util.cpp:139–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

137}
138
139bool StringToFloat(const std::string& str, double* value) {
140 char* end = nullptr;
141 double v = std::strtof(str.data(), &end);
142 if (end == str.data()) {
143 return false;
144 } else {
145 *value = v;
146 return true;
147 }
148}
149
150} // namespace
151

Callers 1

ParseFloatFromEnvFunction · 0.85

Calls 1

dataMethod · 0.45

Tested by

no test coverage detected