mirror of
https://github.com/fastfloat/fast_float.git
synced 2026-10-28 18:07:16 +08:00
unfck
This commit is contained in:
parent
c8894d3722
commit
af9f2b8dc2
@ -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<UC>(
|
||||
@ -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) {
|
||||
|
||||
@ -300,7 +300,7 @@ parse_mantissa(bigint &result, const parsed_number_string_t<UC> &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);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user