[libc-commits] [libc] [libc][NFC] Clean up conversion warnings in math function implementations. (PR #74697)

via libc-commits libc-commits at lists.llvm.org
Thu Dec 7 08:46:47 PST 2023


================
@@ -110,12 +110,12 @@ template <size_t Bits> struct DyadicFloat {
       exp_hi = FloatProperties<T>::EXPONENT_BIAS;
     }
 
-    int exp_lo = exp_hi - PRECISION - 1;
+    int exp_lo = exp_hi - static_cast<int>(PRECISION) - 1;
----------------
lntue wrote:

I change the `PRECISION` to `uint32_t` to match `MANTISSA_WIDTH`, but the cast is still needed for making the unsigned-to-signed conversion explicit.

https://github.com/llvm/llvm-project/pull/74697


More information about the libc-commits mailing list