diff --git a/libc/src/math/generic/exp2f.cpp b/libc/src/math/generic/exp2f.cpp --- a/libc/src/math/generic/exp2f.cpp +++ b/libc/src/math/generic/exp2f.cpp @@ -65,7 +65,7 @@ double c2 = fputil::multiply_add(xd, COEFFS[5], COEFFS[4]); double p = fputil::polyeval(xsq, c0, c1, c2); double r = fputil::multiply_add(p, xd, 1.0); - return r; + return static_cast(r); } // x >= 128 diff --git a/libc/src/math/generic/tanhf.cpp b/libc/src/math/generic/tanhf.cpp --- a/libc/src/math/generic/tanhf.cpp +++ b/libc/src/math/generic/tanhf.cpp @@ -56,7 +56,7 @@ if (LIBC_UNLIKELY(xbits.is_nan())) return x + 1.0f; // sNaN to qNaN + signal - const double SIGNS[2][2] = {{1.0f, -0x1.0p-25f}, {-1.0f, 0x1.0p-25f}}; + constexpr float SIGNS[2][2] = {{1.0f, -0x1.0p-25f}, {-1.0f, 0x1.0p-25f}}; bool sign = xbits.get_sign(); int idx = static_cast(sign); diff --git a/libc/src/time/difftime.cpp b/libc/src/time/difftime.cpp --- a/libc/src/time/difftime.cpp +++ b/libc/src/time/difftime.cpp @@ -12,7 +12,7 @@ namespace __llvm_libc { LLVM_LIBC_FUNCTION(double, difftime, (time_t end, time_t beginning)) { - return end - beginning; + return static_cast(end - beginning); } } // namespace __llvm_libc