mirror of
https://github.com/fastfloat/fast_float.git
synced 2026-01-01 03:12:18 +08:00
type usage fixes.
This commit is contained in:
parent
351e4d30ab
commit
35bca9cb34
@ -141,13 +141,16 @@ compute_float(am_pow_t q, am_mant_t w) noexcept {
|
||||
// branchless approach: value128 product = compute_product(q, w); but in
|
||||
// practice, we can win big with the compute_product_approximation if its
|
||||
// additional branch is easily predicted. Which is best is data specific.
|
||||
auto const upperbit = product.high >> 63;
|
||||
auto const shift = upperbit + 64 - binary::mantissa_explicit_bits() - 3;
|
||||
am_pow_t const upperbit = product.high >> 63;
|
||||
am_pow_t const shift = upperbit + 64 - binary::mantissa_explicit_bits() - 3;
|
||||
|
||||
// Shift right the mantissa to the correct position
|
||||
answer.mantissa = product.high >> shift;
|
||||
|
||||
answer.power2 = detail::power(q) + upperbit - lz - binary::minimum_exponent();
|
||||
|
||||
// Now, we need to round the mantissa correctly.
|
||||
|
||||
if (answer.power2 <= 0) { // we have a subnormal or very small value.
|
||||
// Here have that answer.power2 <= 0 so -answer.power2 >= 0
|
||||
if (-answer.power2 + 1 >=
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user