mirror of
https://github.com/fastfloat/fast_float.git
synced 2025-12-07 01:06:48 +08:00
fix for the parse_number_string
This commit is contained in:
parent
f14d482767
commit
7bac32408e
@ -473,13 +473,13 @@ parse_number_string(UC const *p, UC const *pend,
|
|||||||
// We need to be mindful of the case where we only have zeroes...
|
// We need to be mindful of the case where we only have zeroes...
|
||||||
// E.g., 0.000000000...000.
|
// E.g., 0.000000000...000.
|
||||||
UC const *start = start_digits;
|
UC const *start = start_digits;
|
||||||
do { // we already have some numbers, so we can skip first check safely
|
while ((start != pend) &&
|
||||||
if ((*start == UC('0') || *start == options.decimal_point)) {
|
(*start == UC('0') || *start == options.decimal_point)) {
|
||||||
if (*start == UC('0')) {
|
if (*start == UC('0')) {
|
||||||
--digit_count;
|
--digit_count;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} while (++start != pend);
|
++start;
|
||||||
|
}
|
||||||
|
|
||||||
// We have to check if we have a number with more than 19 significant
|
// We have to check if we have a number with more than 19 significant
|
||||||
// digits.
|
// digits.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user