about summary refs log tree commit diff
path: root/sysdeps/ieee754/ldbl-96/e_gammal_r.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2001-03-17 03:41:58 +0000
committerUlrich Drepper <drepper@redhat.com>2001-03-17 03:41:58 +0000
commit276ae1f29c34cfbc579e7959e8f0bc65916672c0 (patch)
treea6e98b3e76a371d6ac2305060fbcb5cd4d0c09af /sysdeps/ieee754/ldbl-96/e_gammal_r.c
parent7c91639ec9a640dd9637495a329468aea5818529 (diff)
downloadglibc-276ae1f29c34cfbc579e7959e8f0bc65916672c0.tar.gz
glibc-276ae1f29c34cfbc579e7959e8f0bc65916672c0.tar.xz
glibc-276ae1f29c34cfbc579e7959e8f0bc65916672c0.zip
Update.
	* sysdeps/ieee754/ldbl-96/e_gammal_r.c (__ieee754_gammal_r):
	Handle NaN here.
Diffstat (limited to 'sysdeps/ieee754/ldbl-96/e_gammal_r.c')
-rw-r--r--sysdeps/ieee754/ldbl-96/e_gammal_r.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/sysdeps/ieee754/ldbl-96/e_gammal_r.c b/sysdeps/ieee754/ldbl-96/e_gammal_r.c
index 376d2b9d94..9b8cad8e6d 100644
--- a/sysdeps/ieee754/ldbl-96/e_gammal_r.c
+++ b/sysdeps/ieee754/ldbl-96/e_gammal_r.c
@@ -38,18 +38,21 @@ __ieee754_gammal_r (long double x, int *signgamp)
       *signgamp = 0;
       return x / x;
     }
-  if ((es & 0x8000) != 0 && x < 0xffffffff && __rintl (x) == x)
-    {
-      /* Return value for integer x < 0 is NaN with invalid exception.  */
-      *signgamp = 0;
-      return (x - x) / (x - x);
-    }
   if (es == 0xffffffff && ((hx & 0x7fffffff) | lx) == 0)
     {
       /* x == -Inf.  According to ISO this is NaN.  */
       *signgamp = 0;
       return x - x;
     }
+  if ((es & 0x7fff) == 0x7fff && ((hx & 0x7fffffff) | lx) != 0)
+    /* NaN, return it.  */
+    return x;
+  if ((es & 0x8000) != 0 && x < 0xffffffff && __rintl (x) == x)
+    {
+      /* Return value for integer x < 0 is NaN with invalid exception.  */
+      *signgamp = 0;
+      return (x - x) / (x - x);
+    }
 
   /* XXX FIXME.  */
   return __ieee754_expl (__ieee754_lgammal_r (x, signgamp));