This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Fix ldbl-128ibm log1pl (sNaN) (bug 20234) [committed]
- From: Joseph Myers <joseph at codesourcery dot com>
- To: <libc-alpha at sourceware dot org>
- Date: Thu, 9 Jun 2016 17:26:28 +0000
- Subject: Fix ldbl-128ibm log1pl (sNaN) (bug 20234) [committed]
- Authentication-results: sourceware.org; auth=none
The ldbl-128ibm version of log1pl returns sNaN for sNaN input. This
patch fixes it to add such inputs to themselves so that qNaN is
returned in this case.
Tested for powerpc. Committed.
2016-06-09 Joseph Myers <joseph@codesourcery.com>
[BZ #20234]
* sysdeps/ieee754/ldbl-128ibm/s_log1pl.c (__log1pl): Add positive
infinity or NaN input to itself.
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_log1pl.c b/sysdeps/ieee754/ldbl-128ibm/s_log1pl.c
index 743693b..5457892 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_log1pl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_log1pl.c
@@ -132,7 +132,7 @@ __log1pl (long double xm1)
xhi = ldbl_high (xm1);
EXTRACT_WORDS (hx, lx, xhi);
if (hx >= 0x7ff00000)
- return xm1;
+ return xm1 + xm1;
/* log1p(+- 0) = +- 0. */
if (((hx & 0x7fffffff) | lx) == 0)
--
Joseph S. Myers
joseph@codesourcery.com