]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Fix ldbl-128 j0l, j1l, y0l, y1l for sNaN argument (bug 20151).
authorJoseph Myers <joseph@codesourcery.com>
Thu, 26 May 2016 20:55:03 +0000 (20:55 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Thu, 26 May 2016 20:55:03 +0000 (20:55 +0000)
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.

[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).

ChangeLog
sysdeps/ieee754/ldbl-128/e_j0l.c
sysdeps/ieee754/ldbl-128/e_j1l.c

index 289d46c7de99f51ae86086e233c3c507ff44ae41..b597ce964356bf68023820f598d291c7136ddef2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 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).
+
        * math/libm-test.inc (acosh_test_data): Add sNaN tests.
        (atan_test_data): Likewise.
        (ceil_test_data): Likewise.
index c208916a790501451eab591a2eafb52208f9db23..ddc82143dcb39c1baa8af1330a541e9420b788ff 100644 (file)
@@ -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;
     }
index f5b04c073d0f4c51233fbb7490a89ab352a44b6d..32652049abd9c630a1a29818175addc919ce75f7 100644 (file)
@@ -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;
     }