diff --git a/include/fast_float/bigint.h b/include/fast_float/bigint.h index 489ad11..f37e2a9 100644 --- a/include/fast_float/bigint.h +++ b/include/fast_float/bigint.h @@ -32,7 +32,7 @@ typedef span limb_span; // of bits required to store the largest bigint, which is // `log2(10**(digits + max_exp))`, or `log2(10**(767 + 342))`, or // ~3600 bits, so we round to 4000. -typedef uint16_t bigint_bits_t; +typedef uint_fast16_t bigint_bits_t; constexpr bigint_bits_t bigint_bits = 4000; constexpr limb_t bigint_limbs = bigint_bits / limb_bits; @@ -41,7 +41,7 @@ constexpr limb_t bigint_limbs = bigint_bits / limb_bits; template struct stackvec { limb data[size]; // we never need more than 150 limbs - uint8_t length{0}; + uint_fast8_t length{0}; FASTFLOAT_CONSTEXPR20 stackvec() noexcept = default; stackvec(stackvec const &) = delete; diff --git a/include/fast_float/digit_comparison.h b/include/fast_float/digit_comparison.h index ba3a5bc..f3f5e0c 100644 --- a/include/fast_float/digit_comparison.h +++ b/include/fast_float/digit_comparison.h @@ -39,7 +39,7 @@ constexpr static uint64_t powers_of_ten_uint64[] = {1UL, // effect on performance: in order to have a faster algorithm, we'd need // to slow down performance for faster algorithms, and this is still fast. template -fastfloat_really_inline FASTFLOAT_CONSTEXPR14 int16_t +fastfloat_really_inline FASTFLOAT_CONSTEXPR14 int_fast16_t scientific_exponent(parsed_number_string_t const &num) noexcept { am_mant_t mantissa = num.mantissa; am_pow_t exponent = num.exponent; @@ -116,7 +116,7 @@ fastfloat_really_inline FASTFLOAT_CONSTEXPR14 void round(adjusted_mantissa &am, if (-am.power2 >= mantissa_shift) { // have a denormal float am_pow_t shift = -am.power2 + 1; - cb(am, std::min(shift, 64)); + cb(am, std::min(shift, 64)); // check for round-up: if rounding-nearest carried us to the hidden bit. am.power2 = (am.mantissa < (am_mant_t(1) << binary_format::mantissa_explicit_bits())) diff --git a/include/fast_float/float_common.h b/include/fast_float/float_common.h index 90eecc2..a1c2fff 100644 --- a/include/fast_float/float_common.h +++ b/include/fast_float/float_common.h @@ -34,12 +34,12 @@ namespace fast_float { // The number of digits in the mantissa. -typedef uint16_t am_digits; +typedef uint_fast16_t am_digits; // The number of bits in the limb. -typedef uint8_t limb_t; +typedef uint_fast8_t limb_t; -typedef uint8_t chars_format_t; +typedef uint_fast8_t chars_format_t; enum class chars_format : chars_format_t; @@ -444,13 +444,13 @@ full_multiplication(uint64_t a, uint64_t b) noexcept { } // Value of the mantissa. -typedef uint64_t am_mant_t; +typedef uint_fast64_t am_mant_t; // Size of bits in the mantissa. -typedef uint8_t am_bits_t; +typedef uint_fast8_t am_bits_t; // Power bias is signed for handling a denormal float // or an invalid mantissa. -typedef int16_t am_pow_t; +typedef int_fast16_t am_pow_t; // Bias so we can get the real exponent with an invalid adjusted_mantissa. constexpr static am_pow_t invalid_am_bias = -0x8000;