Skip to content

Commit 35bca9c

Browse files
committed
type usage fixes.
1 parent 351e4d3 commit 35bca9c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

include/fast_float/decimal_to_binary.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,16 @@ compute_float(am_pow_t q, am_mant_t w) noexcept {
141141
// branchless approach: value128 product = compute_product(q, w); but in
142142
// practice, we can win big with the compute_product_approximation if its
143143
// additional branch is easily predicted. Which is best is data specific.
144-
auto const upperbit = product.high >> 63;
145-
auto const shift = upperbit + 64 - binary::mantissa_explicit_bits() - 3;
144+
am_pow_t const upperbit = product.high >> 63;
145+
am_pow_t const shift = upperbit + 64 - binary::mantissa_explicit_bits() - 3;
146146

147147
// Shift right the mantissa to the correct position
148148
answer.mantissa = product.high >> shift;
149149

150150
answer.power2 = detail::power(q) + upperbit - lz - binary::minimum_exponent();
151+
152+
// Now, we need to round the mantissa correctly.
153+
151154
if (answer.power2 <= 0) { // we have a subnormal or very small value.
152155
// Here have that answer.power2 <= 0 so -answer.power2 >= 0
153156
if (-answer.power2 + 1 >=

0 commit comments

Comments
 (0)