This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Fix ldbl-128 j0l, j1l, y0l, y1l for sNaN argument (bug 20151) [committed]
- From: Joseph Myers <joseph at codesourcery dot com>
- To: <libc-alpha at sourceware dot org>
- Date: Thu, 26 May 2016 20:55:55 +0000
- Subject: Fix ldbl-128 j0l, j1l, y0l, y1l for sNaN argument (bug 20151) [committed]
- Authentication-results: sourceware.org; auth=none
The ldbl-128 implementations of j0l, j1l, y0l, y1l (also used for
ldbl-128ibm) return an sNaN argument unchanged. This patch fixes them
to add a NaN argument to itself to quiet it before return.
Tested for mips64. Committed.
2016-05-26 Joseph Myers <joseph@codesourcery.com>
[BZ #20151]
* sysdeps/ieee754/ldbl-128/e_j0l.c (__ieee754_j0l): Add NaN
argument to itself before returning result.
(__ieee754_y0l): Likewise.
* sysdeps/ieee754/ldbl-128/e_j1l.c (__ieee754_j1l): Likewise.
(__ieee754_y1l).
diff --git a/sysdeps/ieee754/ldbl-128/e_j0l.c b/sysdeps/ieee754/ldbl-128/e_j0l.c
index c208916..ddc8214 100644
--- a/sysdeps/ieee754/ldbl-128/e_j0l.c
+++ b/sysdeps/ieee754/ldbl-128/e_j0l.c
@@ -683,7 +683,7 @@ __ieee754_j0l (long double x)
if (! isfinite (x))
{
if (x != x)
- return x;
+ return x + x;
else
return 0.0L;
}
@@ -831,7 +831,7 @@ long double
if (! isfinite (x))
{
if (x != x)
- return x;
+ return x + x;
else
return 0.0L;
}
diff --git a/sysdeps/ieee754/ldbl-128/e_j1l.c b/sysdeps/ieee754/ldbl-128/e_j1l.c
index f5b04c0..3265204 100644
--- a/sysdeps/ieee754/ldbl-128/e_j1l.c
+++ b/sysdeps/ieee754/ldbl-128/e_j1l.c
@@ -690,7 +690,7 @@ __ieee754_j1l (long double x)
if (! isfinite (x))
{
if (x != x)
- return x;
+ return x + x;
else
return 0.0L;
}
@@ -849,7 +849,7 @@ __ieee754_y1l (long double x)
if (! isfinite (x))
{
if (x != x)
- return x;
+ return x + x;
else
return 0.0L;
}
--
Joseph S. Myers
joseph@codesourcery.com