mirror of
https://github.com/fastfloat/fast_float.git
synced 2026-01-01 03:12:18 +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 {
|
||||
// an unsigned int avoids signed overflows (which are bad)
|
||||
am_mant_t mantissa{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};
|
||||
#ifndef FASTFLOAT_ONLY_POSITIVE_C_NUMBER_WO_INF_NAN
|
||||
bool negative{false};
|
||||
#endif
|
||||
bool invalid{false};
|
||||
bool too_many_digits{false};
|
||||
// contains the range of the significant digits
|
||||
span<UC const> integer{}; // non-nullable
|
||||
span<UC const> fraction{}; // nullable
|
||||
parse_error error{parse_error::no_error};
|
||||
bool invalid{false}; // be optimistic
|
||||
bool too_many_digits{false}; // be optimistic
|
||||
parse_error error{parse_error::no_error}; // be optimistic
|
||||
};
|
||||
|
||||
using byte_span = span<char const>;
|
||||
|
||||
@ -502,7 +502,7 @@ full_multiplication(uint64_t a, uint64_t b) noexcept {
|
||||
}
|
||||
|
||||
// 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
|
||||
typedef int_fast8_t am_bits_t;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user