mirror of
https://github.com/fastfloat/fast_float.git
synced 2026-01-01 03:12:18 +08:00
Skip leading zeros
This commit is contained in:
parent
122220e2f0
commit
c9527c2e4f
@ -460,6 +460,11 @@ from_chars_result_t<UC> parse_int_string(UC const* p, UC const* pend, T& value,
|
||||
++p;
|
||||
}
|
||||
|
||||
// skip leading zeros
|
||||
while (p != pend && *p == UC('0')) {
|
||||
++p;
|
||||
}
|
||||
|
||||
UC const* const start_digits = p;
|
||||
|
||||
uint64_t i = 0;
|
||||
|
||||
@ -747,7 +747,7 @@ fastfloat_really_inline
|
||||
constexpr int max_digits_u64(int base) { return int_luts<>::maxdigits_u64[base - 2]; }
|
||||
|
||||
// If a u64 is exactly max_digits_u64() in length, this is
|
||||
// the minimum value below which it has definitely overflowed.
|
||||
// the value below which it has definitely overflowed.
|
||||
fastfloat_really_inline
|
||||
constexpr uint64_t min_safe_u64(int base) { return int_luts<>::min_safe_u64[base - 2]; }
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user