mirror of
https://github.com/fastfloat/fast_float.git
synced 2026-02-06 01:39:51 +08:00
* optimize layout of the parsed_number_string_t.
This commit is contained in:
parent
b7fb05b843
commit
2aba1685b0
@ -250,19 +250,18 @@ enum class parse_error : uint_fast8_t {
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <typename UC> struct parsed_number_string_t {
|
template <typename UC> struct parsed_number_string_t {
|
||||||
// an unsigned int avoids signed overflows (which are bad)
|
|
||||||
am_mant_t mantissa{0};
|
am_mant_t mantissa{0};
|
||||||
am_pow_t exponent{0};
|
am_pow_t exponent{0};
|
||||||
|
// contains the range of the significant digits
|
||||||
|
span<UC const> integer{}; // non-nullable
|
||||||
|
span<UC const> fraction{}; // nullable
|
||||||
UC const *lastmatch{nullptr};
|
UC const *lastmatch{nullptr};
|
||||||
#ifndef FASTFLOAT_ONLY_POSITIVE_C_NUMBER_WO_INF_NAN
|
#ifndef FASTFLOAT_ONLY_POSITIVE_C_NUMBER_WO_INF_NAN
|
||||||
bool negative{false};
|
bool negative{false};
|
||||||
#endif
|
#endif
|
||||||
bool invalid{false};
|
bool invalid{false}; // be optimistic
|
||||||
bool too_many_digits{false};
|
bool too_many_digits{false}; // be optimistic
|
||||||
// contains the range of the significant digits
|
parse_error error{parse_error::no_error}; // be optimistic
|
||||||
span<UC const> integer{}; // non-nullable
|
|
||||||
span<UC const> fraction{}; // nullable
|
|
||||||
parse_error error{parse_error::no_error};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
using byte_span = span<char const>;
|
using byte_span = span<char const>;
|
||||||
|
|||||||
@ -502,7 +502,7 @@ full_multiplication(uint64_t a, uint64_t b) noexcept {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Value of the mantissa.
|
// Value of the mantissa.
|
||||||
typedef uint_fast64_t am_mant_t;
|
typedef uint_fast64_t am_mant_t; // an unsigned int avoids signed overflows (which are bad)
|
||||||
// Size of bits in the mantissa and path and rounding shifts
|
// Size of bits in the mantissa and path and rounding shifts
|
||||||
typedef int_fast8_t am_bits_t;
|
typedef int_fast8_t am_bits_t;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user