MCPcopy Create free account
hub / github.com/NVIDIA-RTX/Donut / float_vector_to_string

Function float_vector_to_string

src/engine/ConsoleObjects.cpp:520–537  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

518
519 // A specialization of vector_to_string to work around std::to_chars being unavailable for float on clang
520 template <int N> std::string float_vector_to_string(dm::vector<float, N> v)
521 {
522 std::string result;
523 for (int i = 0; i < N; ++i)
524 {
525 char buff[16] = { 0 };
526 int c = snprintf(buff, sizeof(buff), "%f", v[i]);
527
528 if (c < sizeof(buff))
529 {
530 if (i < (N - 1))
531 buff[strlen(buff)] = ' ';
532
533 result += buff;
534 }
535 }
536 return result;
537 }
538
539 std::string float_to_string(float v)
540 {

Callers 1

GetValueAsStringMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected