From patchwork Fri Jul 5 14:23:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcus Haehnel X-Patchwork-Id: 1957335 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=oZA9xNIG; 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)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WFwjs0bwLz1xql for ; Sat, 6 Jul 2024 00:23:45 +1000 (AEST) Received: from helium.openadk.org (localhost [IPv6:::1]) by helium.openadk.org (Postfix) with ESMTP id E237E35363AF; Fri, 5 Jul 2024 16:23:36 +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=oZA9xNIG; dkim-atps=neutral Received: from mx.kernkonzept.com (serv1.kernkonzept.com [159.69.200.6]) by helium.openadk.org (Postfix) with ESMTPS id D8B4A3528237 for ; Fri, 5 Jul 2024 16:23:32 +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=3OqE5QCHjUrV9mpibVI5b7FdvkM+9z3RNMOx8BFKTPI=; b=oZA9xNIGb+uOdyt4STQX2fjcdL ir5fCcBfvjPPdHn0JqVQUGQdT2yFp4Qq9z1MgSqfruNwEsq7qQDFALCpqTrzJnr5H2LTwbMWzSPmg PQgOjAY7ibpR/Z4aFLJv8zv9bgnlEwE7j8BypztiNBNFGnfphrEQpZH6jvAr53qxPOkculZqVUUhZ k7OfBcIedG+XL6zwWOk17Wh98B17faiRnseG+37fOFb72/j8MontVLMPU/fddYzBD0Na3Sq5SRnQM 9WX7/oJ0WODa7FMj6Vijl5/z5JYo+PtLlH4FUOENQuO0uf54LFJoE8ocDDeUDXrPYKClraOc1/Zm8 PWXr4k7Q==; Received: from ipb21a422b.dynamic.kabel-deutschland.de ([178.26.66.43] 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 1sPjqV-000HQk-1o; Fri, 05 Jul 2024 16:23:32 +0200 From: Marcus Haehnel To: devel@uclibc-ng.org Date: Fri, 5 Jul 2024 16:23:09 +0200 Message-ID: <20240705142326.9492-1-marcus.haehnel@kernkonzept.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Message-ID-Hash: 47OYSWRGZ3K32DYAYROYBVXDIHLU3FYL X-Message-ID-Hash: 47OYSWRGZ3K32DYAYROYBVXDIHLU3FYL 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] 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. Signed-off-by: Sven Linker --- 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;