Skip to content

Commit

Permalink
Update float_common.h
Browse files Browse the repository at this point in the history
The construct !! is a no-op for a bool, op< for uint64_t's.  Removed it and made it an explicit cast to match the operations being performed
  • Loading branch information
beached authored Dec 28, 2023
1 parent b90ba25 commit b43f808
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/fast_float/float_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -284,10 +284,10 @@ uint64_t umul128_generic(uint64_t ab, uint64_t cd, uint64_t *hi) {
uint64_t ad = emulu((uint32_t)(ab >> 32), (uint32_t)cd);
uint64_t bd = emulu((uint32_t)ab, (uint32_t)cd);
uint64_t adbc = ad + emulu((uint32_t)ab, (uint32_t)(cd >> 32));
uint64_t adbc_carry = !!(adbc < ad);
uint64_t adbc_carry = (uint64_t)(adbc < ad);
uint64_t lo = bd + (adbc << 32);
*hi = emulu((uint32_t)(ab >> 32), (uint32_t)(cd >> 32)) + (adbc >> 32) +
(adbc_carry << 32) + !!(lo < bd);
(adbc_carry << 32) + (uint64_t)(lo < bd);
return lo;
}

Expand Down

0 comments on commit b43f808

Please sign in to comment.