Update.
authorUlrich Drepper <drepper@redhat.com>
Sat, 17 Mar 2001 03:41:58 +0000 (03:41 +0000)
committerUlrich Drepper <drepper@redhat.com>
Sat, 17 Mar 2001 03:41:58 +0000 (03:41 +0000)
* sysdeps/ieee754/ldbl-96/e_gammal_r.c (__ieee754_gammal_r):
Handle NaN here.

ChangeLog
sysdeps/ieee754/ldbl-96/e_gammal_r.c

index a31102e..c1d9c3e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2001-03-16  Ulrich Drepper  <drepper@redhat.com>
 
+       * sysdeps/ieee754/ldbl-96/e_gammal_r.c (__ieee754_gammal_r):
+       Handle NaN here.
+
        * sysdeps/unix/sysv/linux/ia64/makecontext.c (__makecontext):
        Internationalize.
 
index 376d2b9..9b8cad8 100644 (file)
@@ -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));