diff --git a/include/fast_float/ascii_number.h b/include/fast_float/ascii_number.h index 8f58c42..aa2fb34 100644 --- a/include/fast_float/ascii_number.h +++ b/include/fast_float/ascii_number.h @@ -628,20 +628,19 @@ parse_number_string(UC const *p, UC const *pend, span(before, static_cast(p - before)); } digit_count -= static_cast(answer.exponent); -#ifndef FASTFLOAT_ONLY_POSITIVE_C_NUMBER_WO_INF_NAN - if FASTFLOAT_CONSTEXPR17 (json_fmt) { - // at least 1 digit in fractional part - if (answer.exponent == 0) { - return report_parse_error( - answer, p, parse_error::no_digits_in_fractional_part); - } - } -#endif } +#ifndef FASTFLOAT_ONLY_POSITIVE_C_NUMBER_WO_INF_NAN + if FASTFLOAT_CONSTEXPR17 (json_fmt) { + // at least 1 digit in fractional part + if (answer.exponent == 0) { + return report_parse_error(answer, p, + parse_error::no_digits_in_fractional_part); + } + } +#endif #ifndef FASTFLOAT_ISNOT_CHECKED_BOUNDS // External parser already check that this is num and it's exist - else if (digit_count == 0) { - // We must have encountered at least one integer! + else if (digit_count == 0) { // We must have encountered at least one integer! return report_parse_error(answer, p, parse_error::no_digits_in_mantissa); }