MCPcopy Create free account
hub / github.com/catboost/catboost / StrToD

Function StrToD

util/string/cast.cpp:633–650  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

631}
632
633double StrToD(const char* b, const char* e, char** se) {
634 struct TCvt: public StringToDoubleConverter {
635 inline TCvt()
636 : StringToDoubleConverter(ALLOW_TRAILING_JUNK | ALLOW_HEX | ALLOW_LEADING_SPACES, 0.0, NAN, nullptr, nullptr)
637 {
638 }
639 };
640
641 int out = 0;
642
643 const auto res = SingletonWithPriority<TCvt, 0>()->StringToDouble(b, e - b, &out);
644
645 if (se) {
646 *se = (char*)(b + out);
647 }
648
649 return res;
650}
651
652double StrToD(const char* b, char** se) {
653 return StrToD(b, b + strlen(b), se);

Callers 3

Y_UNIT_TESTFunction · 0.85

Calls 1

StringToDoubleMethod · 0.80

Tested by

no test coverage detected