mirror of
https://github.com/fastfloat/fast_float.git
synced 2025-12-06 16:56:57 +08:00
* try to fix precision error on x86 platform step8.
This commit is contained in:
parent
1ba0d482c1
commit
97aa629922
@ -439,7 +439,7 @@ parse_number_string(UC const *p, UC const *pend,
|
|||||||
} else {
|
} else {
|
||||||
// Now let's parse the explicit exponent.
|
// Now let's parse the explicit exponent.
|
||||||
while ((p != pend) && is_integer(*p)) {
|
while ((p != pend) && is_integer(*p)) {
|
||||||
if (exp_number < 0x1000) {
|
if (exp_number < 0x10000000) {
|
||||||
// check for exponent overflow if we have too many digits.
|
// check for exponent overflow if we have too many digits.
|
||||||
UC const digit = UC(*p - UC('0'));
|
UC const digit = UC(*p - UC('0'));
|
||||||
exp_number = 10 * exp_number + static_cast<am_pow_t>(digit);
|
exp_number = 10 * exp_number + static_cast<am_pow_t>(digit);
|
||||||
|
|||||||
@ -39,7 +39,7 @@ constexpr limb_t bigint_limbs = bigint_bits / limb_bits;
|
|||||||
// vector-like type that is allocated on the stack. the entire
|
// vector-like type that is allocated on the stack. the entire
|
||||||
// buffer is pre-allocated, and only the length changes.
|
// buffer is pre-allocated, and only the length changes.
|
||||||
template <limb_t size> struct stackvec {
|
template <limb_t size> struct stackvec {
|
||||||
limb data[size] = {0};
|
limb data[size];
|
||||||
// we never need more than 150 limbs
|
// we never need more than 150 limbs
|
||||||
uint_fast8_t length{0};
|
uint_fast8_t length{0};
|
||||||
|
|
||||||
|
|||||||
@ -446,7 +446,7 @@ typedef int_fast8_t am_bits_t;
|
|||||||
|
|
||||||
// Power bias is signed for handling a denormal float
|
// Power bias is signed for handling a denormal float
|
||||||
// or an invalid mantissa.
|
// or an invalid mantissa.
|
||||||
typedef int32_t am_pow_t;
|
typedef int_fast32_t am_pow_t;
|
||||||
|
|
||||||
// Bias so we can get the real exponent with an invalid adjusted_mantissa.
|
// Bias so we can get the real exponent with an invalid adjusted_mantissa.
|
||||||
constexpr static am_pow_t invalid_am_bias = -0x8000;
|
constexpr static am_pow_t invalid_am_bias = -0x8000;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user