From ee077ec4d9351c9f9c3e1293dfb3da8e1fe36261 Mon Sep 17 00:00:00 2001 From: Marcus Haehnel Date: Tue, 9 Jul 2024 09:39:33 +0200 Subject: libm: Fix float conversion compiler warning Make two implicit casts from double to int explicit to silence compiler warnings about them. The casts are required during the computation of exponentiation. Co-authored-by: Sven Linker Signed-off-by: Marcus Haehnel --- libm/e_exp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libm/e_exp.c') diff --git a/libm/e_exp.c b/libm/e_exp.c index ffa556120..f694f67d1 100644 --- a/libm/e_exp.c +++ b/libm/e_exp.c @@ -126,7 +126,7 @@ double __ieee754_exp(double x) /* default IEEE double exp */ if(hx < 0x3FF0A2B2) { /* and |x| < 1.5 ln2 */ hi = x-ln2HI[xsb]; lo=ln2LO[xsb]; k = 1-xsb-xsb; } else { - k = invln2*x+halF[xsb]; + k = (int32_t)(invln2*x+halF[xsb]); t = k; hi = x - t*ln2HI[0]; /* t*ln2HI is exact here */ lo = t*ln2LO[0]; -- cgit v1.2.3