From 689fba95b5b45cc39f3e77986a6de96884489366 Mon Sep 17 00:00:00 2001 From: Daniel Lemire Date: Tue, 10 Nov 2020 20:38:23 -0500 Subject: [PATCH] Minor simplification. --- include/fast_float/decimal_to_binary.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/include/fast_float/decimal_to_binary.h b/include/fast_float/decimal_to_binary.h index 3ac4737..655d37d 100644 --- a/include/fast_float/decimal_to_binary.h +++ b/include/fast_float/decimal_to_binary.h @@ -107,9 +107,8 @@ adjusted_mantissa compute_float(int64_t q, uint64_t w) noexcept { uint64_t upperbit = product.high >> 63; answer.mantissa = product.high >> (upperbit + 64 - binary::mantissa_explicit_bits() - 3); - lz += int(1 ^ upperbit); - - answer.power2 = power(int(q)) - lz - binary::minimum_exponent() + 1; + + answer.power2 = power(int(q)) + upperbit - lz - binary::minimum_exponent(); if (answer.power2 <= 0) { // we have a subnormal? // Here have that answer.power2 <= 0 so -answer.power2 >= 0 if(-answer.power2 + 1 >= 64) { // if we have more than 64 bits below the minimum exponent, you have a zero for sure.