From 5820f4b5860f97c66b01bc8e25ea876ae4f07478 Mon Sep 17 00:00:00 2001 From: Marcus Haehnel Date: Tue, 9 Jul 2024 09:38:40 +0200 Subject: 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 Signed-off-by: Marcus Haehnel --- libm/cexp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libm/cexp.c') 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; } -- cgit v1.2.3