summaryrefslogtreecommitdiff
path: root/libm/cexp.c
diff options
context:
space:
mode:
authorMarcus Haehnel <marcus.haehnel@kernkonzept.com>2024-07-09 09:38:40 +0200
committerWaldemar Brodkorb <wbx@openadk.org>2024-07-09 09:53:20 +0200
commit5820f4b5860f97c66b01bc8e25ea876ae4f07478 (patch)
tree026ab686123461d5f89258d0fc41221285679002 /libm/cexp.c
parent6271f8e869a4369b3bbcdd8a58ccce876eeae49b (diff)
uclibc: Fix double promotion warning
Add casts where necessary to convince clang that the promotion of float to double is intentional. Co-authored-by: Sven Linker <sven.linker@kernkonzept.com> Signed-off-by: Marcus Haehnel <marcus.haehnel@kernkonzept.com>
Diffstat (limited to 'libm/cexp.c')
-rw-r--r--libm/cexp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libm/cexp.c b/libm/cexp.c
index 87512b7c5..a08d12d4e 100644
--- a/libm/cexp.c
+++ b/libm/cexp.c
@@ -38,10 +38,10 @@ libm_hidden_proto(cexpf)
__complex__ float cexpf(__complex__ float z)
{
__complex__ float ret;
- double r_exponent = exp(__real__ z);
+ double r_exponent = exp((double)__real__ z);
- __real__ ret = r_exponent * cosf(__imag__ z);
- __imag__ ret = r_exponent * sinf(__imag__ z);
+ __real__ ret = r_exponent * (double) cosf(__imag__ z);
+ __imag__ ret = r_exponent * (double) sinf(__imag__ z);
return ret;
}