From patchwork Tue Jul 9 07:39:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcus Haehnel X-Patchwork-Id: 1958222 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=kernkonzept.com header.i=@kernkonzept.com header.a=rsa-sha256 header.s=mx1 header.b=nhGNVnl0; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=uclibc-ng.org (client-ip=2a00:1828:2000:679::23; helo=helium.openadk.org; envelope-from=devel-bounces@uclibc-ng.org; receiver=patchwork.ozlabs.org) Received: from helium.openadk.org (helium.openadk.org [IPv6:2a00:1828:2000:679::23]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WJCZC67p6z1xpd for ; Tue, 9 Jul 2024 17:40:03 +1000 (AEST) Received: from helium.openadk.org (localhost [IPv6:::1]) by helium.openadk.org (Postfix) with ESMTP id 342BD353622C; Tue, 9 Jul 2024 09:39:53 +0200 (CEST) Authentication-Results: helium.openadk.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=kernkonzept.com header.i=@kernkonzept.com header.a=rsa-sha256 header.s=mx1 header.b=nhGNVnl0; dkim-atps=neutral Received: from mx.kernkonzept.com (serv1.kernkonzept.com [159.69.200.6]) by helium.openadk.org (Postfix) with ESMTPS id 5FBAE3536226 for ; Tue, 9 Jul 2024 09:39:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kernkonzept.com; s=mx1; h=Content-Transfer-Encoding:MIME-Version:Message-ID :Date:Subject:Cc:To:From:References:In-Reply-To:Reply-To:Content-Type: Content-ID:Content-Description; bh=0cG6/dawhpNghm0PlWSim95dQ0KHFUu9C6dOHZTensM=; b=nhGNVnl0aY4fc8ibUT9UAoRpuW skvk8zDdQnfvBxIdoOkEXEv8TdiL01+yd4hYFJ2BQzVllGDbeWRHywrO3ewkm4GHKVhE6sg9NvGzU kpWF7MV9v/JABYnIelsX/IED8PPrQrZaeEDsr1tUUiXV5/7Yfk2SjEZBHNg/cyuM9JxiqwqG1ne0N 7LwSkn6/Awu5CchFv6A7wFuTIhRF7/llEFo/zdhp6ZO29Im3P2sJ9wiruZ/dheggx87qWQVR+sxlb F9YP020kVojvzHaMhrB6yGDLtp5b2W9T3/lpUUc3WS5e6cUQT6VrHkkynPYelyTu/ZVLpI0p0VhZ+ +2ukHRIA==; Received: from [10.22.3.160] (helo=amethyst.dd1.int.kernkonzept.com) by mx.kernkonzept.com with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.96) id 1sR5S0-000nY0-0p; Tue, 09 Jul 2024 09:39:48 +0200 From: Marcus Haehnel To: devel@uclibc-ng.org Date: Tue, 9 Jul 2024 09:39:33 +0200 Message-ID: <20240709073944.22127-1-marcus.haehnel@kernkonzept.com> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 Message-ID-Hash: 7VTWZNYAX6PDS2HMTOYSWOK6AJOSUJWF X-Message-ID-Hash: 7VTWZNYAX6PDS2HMTOYSWOK6AJOSUJWF X-MailFrom: marcus.haehnel@kernkonzept.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Marcus Haehnel , Sven Linker X-Mailman-Version: 3.3.3 Precedence: list Subject: [uclibc-ng-devel] [PATCH v2] libm: Fix float conversion compiler warning List-Id: uClibc-ng Development Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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 +- libm/s_expm1.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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]; diff --git a/libm/s_expm1.c b/libm/s_expm1.c index 8e51ae748..85defefa4 100644 --- a/libm/s_expm1.c +++ b/libm/s_expm1.c @@ -159,7 +159,7 @@ double expm1(double x) else {hi = x + ln2_hi; lo = -ln2_lo; k = -1;} } else { - k = invln2*x+((xsb==0)?0.5:-0.5); + k = (int32_t)(invln2*x+((xsb==0)?0.5:-0.5)); t = k; hi = x - t*ln2_hi; /* t*ln2_hi is exact here */ lo = t*ln2_lo;