MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/Falcor / is_truncated

Function is_truncated

external/include/fast_float/fast_float.h:2631–2648  ·  view source on GitHub ↗

determine if any non-zero digits were truncated. all characters must be valid digits.

Source from the content-addressed store, hash-verified

2629// determine if any non-zero digits were truncated.
2630// all characters must be valid digits.
2631fastfloat_really_inline bool is_truncated(const char* first, const char* last) noexcept {
2632 // do 8-bit optimizations, can just compare to 8 literal 0s.
2633 uint64_t val;
2634 while (std::distance(first, last) >= 8) {
2635 ::memcpy(&val, first, sizeof(uint64_t));
2636 if (val != 0x3030303030303030) {
2637 return true;
2638 }
2639 first += 8;
2640 }
2641 while (first != last) {
2642 if (*first != '0') {
2643 return true;
2644 }
2645 first++;
2646 }
2647 return false;
2648}
2649
2650fastfloat_really_inline bool is_truncated(byte_span s) noexcept {
2651 return is_truncated(s.ptr, s.ptr + s.len());

Callers 1

parse_mantissaFunction · 0.85

Calls 1

lenMethod · 0.45

Tested by

no test coverage detected