From b43f8081904d953e1afd01cad7a8e57b6c0ab140 Mon Sep 17 00:00:00 2001 From: Darrell Wright Date: Wed, 27 Dec 2023 19:43:56 -0500 Subject: [PATCH] Update float_common.h 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 --- include/fast_float/float_common.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/fast_float/float_common.h b/include/fast_float/float_common.h index b5a357b1..a7dfac09 100644 --- a/include/fast_float/float_common.h +++ b/include/fast_float/float_common.h @@ -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; }