@@ -19,7 +19,7 @@ namespace fast_float {
1919//
2020template <limb_t bit_precision>
2121fastfloat_really_inline FASTFLOAT_CONSTEXPR20 value128
22- compute_product_approximation (int64_t q, uint64_t w) noexcept {
22+ compute_product_approximation (am_pow_t q, am_mant_t w) noexcept {
2323 am_pow_t const index = 2 * am_pow_t (q - powers::smallest_power_of_five);
2424 // For small values of q, e.g., q in [0,27], the answer is always exact
2525 // because The line value128 firstproduct = full_multiplication(w,
@@ -71,22 +71,21 @@ constexpr fastfloat_really_inline am_pow_t power(am_pow_t q) noexcept {
7171// for significant digits already multiplied by 10 ** q.
7272template <typename binary>
7373fastfloat_really_inline FASTFLOAT_CONSTEXPR14 adjusted_mantissa
74- compute_error_scaled (int64_t q, uint64_t w, am_digits lz) noexcept {
75- auto const hilz = static_cast <am_digits >((w >> 63 ) ^ 1 );
74+ compute_error_scaled (am_pow_t q, am_mant_t w, am_digits lz) noexcept {
75+ auto const hilz = static_cast <am_pow_t >((w >> 63 ) ^ 1 );
7676 adjusted_mantissa answer;
7777 answer.mantissa = w << hilz;
7878 constexpr am_pow_t bias =
7979 binary::mantissa_explicit_bits () - binary::minimum_exponent ();
80- answer.power2 = am_pow_t (detail::power (am_pow_t (q)) + bias - hilz - lz - 62 +
81- invalid_am_bias);
80+ answer.power2 = detail::power (q) + bias - hilz - lz - 62 + invalid_am_bias;
8281 return answer;
8382}
8483
8584// w * 10 ** q, without rounding the representation up.
8685// the power2 in the exponent will be adjusted by invalid_am_bias.
8786template <typename binary>
8887fastfloat_really_inline FASTFLOAT_CONSTEXPR20 adjusted_mantissa
89- compute_error (int64_t q, uint64_t w) noexcept {
88+ compute_error (am_pow_t q, am_mant_t w) noexcept {
9089 am_digits const lz = leading_zeroes (w);
9190 w <<= lz;
9291 value128 product =
@@ -101,7 +100,7 @@ compute_error(int64_t q, uint64_t w) noexcept {
101100// should recompute in such cases.
102101template <typename binary>
103102fastfloat_really_inline FASTFLOAT_CONSTEXPR20 adjusted_mantissa
104- compute_float (int64_t q, uint64_t w) noexcept {
103+ compute_float (am_pow_t q, am_mant_t w) noexcept {
105104 adjusted_mantissa answer;
106105 if ((w == 0 ) || (q < binary::smallest_power_of_ten ())) {
107106 answer.power2 = 0 ;
@@ -144,8 +143,7 @@ compute_float(int64_t q, uint64_t w) noexcept {
144143
145144 answer.mantissa = product.high >> shift;
146145
147- answer.power2 = am_pow_t (detail::power (am_pow_t (q)) + upperbit - lz -
148- binary::minimum_exponent ());
146+ answer.power2 = detail::power (q) + upperbit - lz - binary::minimum_exponent ();
149147 if (answer.power2 <= 0 ) { // we have a subnormal or very small value.
150148 // Here have that answer.power2 <= 0 so -answer.power2 >= 0
151149 if (-answer.power2 + 1 >=
0 commit comments