MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / is_truncated

Function is_truncated

app/src/ThirdParty/fast_float.h:4226–4245  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4224// all characters must be valid digits.
4225template <typename UC>
4226fastfloat_really_inline FASTFLOAT_CONSTEXPR20 bool
4227is_truncated(UC const *first, UC const *last) noexcept {
4228 // do 8-bit optimizations, can just compare to 8 literal 0s.
4229 uint64_t val;
4230 while (!cpp20_and_in_constexpr() &&
4231 std::distance(first, last) >= int_cmp_len<UC>()) {
4232 ::memcpy(&val, first, sizeof(uint64_t));
4233 if (val != int_cmp_zeros<UC>()) {
4234 return true;
4235 }
4236 first += int_cmp_len<UC>();
4237 }
4238 while (first != last) {
4239 if (*first != UC('0')) {
4240 return true;
4241 }
4242 ++first;
4243 }
4244 return false;
4245}
4246
4247template <typename UC>
4248fastfloat_really_inline FASTFLOAT_CONSTEXPR20 bool

Callers 1

parse_mantissaFunction · 0.85

Calls 2

cpp20_and_in_constexprFunction · 0.85
lenMethod · 0.45

Tested by

no test coverage detected