MCPcopy Create free account
hub / github.com/Open-GD/OpenGD / is_truncated

Function is_truncated

Source/external/fast_float.h:2864–2882  ·  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

2862// determine if any non-zero digits were truncated.
2863// all characters must be valid digits.
2864fastfloat_really_inline FASTFLOAT_CONSTEXPR20
2865bool is_truncated(const char* first, const char* last) noexcept {
2866 // do 8-bit optimizations, can just compare to 8 literal 0s.
2867 uint64_t val;
2868 while (!cpp20_and_in_constexpr() && std::distance(first, last) >= 8) {
2869 ::memcpy(&val, first, sizeof(uint64_t));
2870 if (val != 0x3030303030303030) {
2871 return true;
2872 }
2873 first += 8;
2874 }
2875 while (first != last) {
2876 if (*first != '0') {
2877 return true;
2878 }
2879 first++;
2880 }
2881 return false;
2882}
2883
2884fastfloat_really_inline FASTFLOAT_CONSTEXPR20
2885bool is_truncated(byte_span s) noexcept {

Callers 1

parse_mantissaFunction · 0.85

Calls 2

cpp20_and_in_constexprFunction · 0.85
lenMethod · 0.45

Tested by

no test coverage detected