This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Fix ldbl-128ibm expm1l (sNaN) (bug 20233) [committed]
- From: Joseph Myers <joseph at codesourcery dot com>
- To: <libc-alpha at sourceware dot org>
- Date: Thu, 9 Jun 2016 17:25:26 +0000
- Subject: Fix ldbl-128ibm expm1l (sNaN) (bug 20233) [committed]
- Authentication-results: sourceware.org; auth=none
The ldbl-128ibm version of expm1l 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 #20233]
* sysdeps/ieee754/ldbl-128ibm/s_expm1l.c (__expm1l): Add NaN input
to itself.
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_expm1l.c b/sysdeps/ieee754/ldbl-128ibm/s_expm1l.c
index 66f75e1..42d57c6 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_expm1l.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_expm1l.c
@@ -106,8 +106,8 @@ __expm1l (long double x)
/* Infinity (which must be negative infinity). */
if (((ix - 0x7ff00000) | lx) == 0)
return -1.0L;
- /* NaN. No invalid exception. */
- return x;
+ /* NaN. Invalid exception if signaling. */
+ return x + x;
}
/* expm1(+- 0) = +- 0. */
--
Joseph S. Myers
joseph@codesourcery.com