From patchwork Tue Oct 6 15:15:11 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 8942 Received: (qmail 109477 invoked by alias); 6 Oct 2015 15:15:18 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 108738 invoked by uid 89); 6 Oct 2015 15:15:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Date: Tue, 6 Oct 2015 15:15:11 +0000 From: Joseph Myers To: Subject: Fix ldbl-128ibm log1pl (-1) sign of infinity (bug 19076) [committed] Message-ID: User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 The ldbl-128ibm implementation of log1pl produces an infinity with the wrong sign for log1pl (-1) in FE_DOWNWARD mode. This patch fixes this by changing a division (-1.0L / (x - x)) (incorrect in FE_DOWNWARD mode) to (-1.0L / 0.0L) (correct in all rounding modes). Tested for powerpc. Committed. 2015-10-06 Joseph Myers [BZ #19076] * sysdeps/ieee754/ldbl-128ibm/s_log1pl.c (__log1pl): Divide by constant 0.0L when computing infinite result. diff --git a/sysdeps/ieee754/ldbl-128ibm/s_log1pl.c b/sysdeps/ieee754/ldbl-128ibm/s_log1pl.c index a0e24d7..ad9a1fe 100644 --- a/sysdeps/ieee754/ldbl-128ibm/s_log1pl.c +++ b/sysdeps/ieee754/ldbl-128ibm/s_log1pl.c @@ -149,7 +149,7 @@ __log1pl (long double xm1) if (x <= 0.0L) { if (x == 0.0L) - return (-1.0L / (x - x)); + return (-1.0L / 0.0L); else return (zero / (x - x)); }