Cleanup initialization of the adjusted_mantissa.

This commit is contained in:
IRainman 2025-03-28 18:55:57 +03:00
parent 8ebc89e1b5
commit fc9f61efc9
2 changed files with 5 additions and 5 deletions

View File

@ -103,15 +103,15 @@ fastfloat_really_inline FASTFLOAT_CONSTEXPR20 adjusted_mantissa
compute_float(int64_t q, uint64_t w) noexcept { compute_float(int64_t q, uint64_t w) noexcept {
adjusted_mantissa answer; adjusted_mantissa answer;
if ((w == 0) || (q < binary::smallest_power_of_ten())) { if ((w == 0) || (q < binary::smallest_power_of_ten())) {
// answer.power2 = 0; already set answer.power2 = 0;
// answer.mantissa = 0; already set answer.mantissa = 0;
// result should be zero // result should be zero
return answer; return answer;
} }
if (q > binary::largest_power_of_ten()) { if (q > binary::largest_power_of_ten()) {
// we want to get infinity: // we want to get infinity:
answer.power2 = binary::infinite_power(); answer.power2 = binary::infinite_power();
// answer.mantissa = 0; already set answer.mantissa = 0;
return answer; return answer;
} }
// At this point in time q is in [powers::smallest_power_of_five, // At this point in time q is in [powers::smallest_power_of_five,

View File

@ -423,8 +423,8 @@ full_multiplication(uint64_t a, uint64_t b) noexcept {
} }
struct adjusted_mantissa { struct adjusted_mantissa {
uint64_t mantissa{0}; uint64_t mantissa;
int32_t power2{0}; // a negative value indicates an invalid result int32_t power2; // a negative value indicates an invalid result
adjusted_mantissa() noexcept = default; adjusted_mantissa() noexcept = default;
constexpr bool operator==(adjusted_mantissa const &o) const noexcept { constexpr bool operator==(adjusted_mantissa const &o) const noexcept {