diff --git a/include/fast_float/ascii_number.h b/include/fast_float/ascii_number.h index 9d1fee5..8f58c42 100644 --- a/include/fast_float/ascii_number.h +++ b/include/fast_float/ascii_number.h @@ -527,8 +527,8 @@ parse_number_string(UC const *p, UC const *pend, answer.negative = *p == UC('-'); if (answer.negative || // C++17 20.19.3.(7.1) explicitly forbids '+' sign here - chars_format_t(options.format & chars_format::allow_leading_plus) && - !json_fmt && *p == UC('+')) { + (chars_format_t(options.format & chars_format::allow_leading_plus) && + !json_fmt && *p == UC('+'))) { ++p; if (p == pend) { return report_parse_error( @@ -650,20 +650,21 @@ parse_number_string(UC const *p, UC const *pend, // Now we can parse the explicit exponential part. am_pow_t exp_number = 0; // explicit exponential part - if (p != pend && (chars_format_t(options.format & chars_format::scientific) && - (UC('e') == *p || UC('E') == *p)) + if (p != pend && + ((chars_format_t(options.format & chars_format::scientific) && + (UC('e') == *p || UC('E') == *p)) #ifndef FASTFLOAT_ONLY_POSITIVE_C_NUMBER_WO_INF_NAN - || (chars_format_t(options.format & detail::fortran_fmt) && - (UC('+') == *p || UC('-') == *p || UC('d') == *p || UC('D') == *p)) + || (chars_format_t(options.format & detail::fortran_fmt) && + (UC('+') == *p || UC('-') == *p || UC('d') == *p || UC('D') == *p)) #endif - ) { + )) { auto const *location_of_e = p; -#ifdef FASTFLOAT_ONLY_POSITIVE_C_NUMBER_WO_INF_NAN - ++p; -#else +#ifndef FASTFLOAT_ONLY_POSITIVE_C_NUMBER_WO_INF_NAN if (UC('e') == *p || UC('E') == *p || UC('d') == *p || UC('D') == *p) { ++p; } +#else + ++p; #endif bool neg_exp = false; if (p != pend) { diff --git a/include/fast_float/digit_comparison.h b/include/fast_float/digit_comparison.h index a094167..de7bf00 100644 --- a/include/fast_float/digit_comparison.h +++ b/include/fast_float/digit_comparison.h @@ -300,7 +300,7 @@ parse_mantissa(bigint &result, const parsed_number_string_t &num) noexcept { #if defined(FASTFLOAT_64BIT_LIMB) && defined(FASTFLOAT_X86_SIMD) && \ FASTFLOAT_X86_SIMD >= 31 if FASTFLOAT_CONSTEXPR17 (sizeof(UC) == 1) { - if (!is_constant_evaluated() std::distance(p, pend) >= 16 && + if (!is_constant_evaluated() && std::distance(p, pend) >= 16 && step - counter >= 16 && max_digits - digits >= 16) { parse_sixteen_digits(p, value, counter, digits); }