aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/ieee754/ldbl-128/e_gammal_r.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/ieee754/ldbl-128/e_gammal_r.c')
-rw-r--r--sysdeps/ieee754/ldbl-128/e_gammal_r.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sysdeps/ieee754/ldbl-128/e_gammal_r.c b/sysdeps/ieee754/ldbl-128/e_gammal_r.c
index 6f0d4b7287..123b559d08 100644
--- a/sysdeps/ieee754/ldbl-128/e_gammal_r.c
+++ b/sysdeps/ieee754/ldbl-128/e_gammal_r.c
@@ -1,5 +1,5 @@
/* Implementation of gamma function according to ISO C.
- Copyright (C) 1997, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1999, 2002 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997 and
Jakub Jelinek <jj@ultra.linux.cz, 1999.
@@ -46,6 +46,12 @@ __ieee754_gammal_r (long double x, int *signgamp)
*signgamp = 0;
return (x - x) / (x - x);
}
+ if (hx == 0xffff000000000000ULL && lx == 0)
+ {
+ /* x == -Inf. According to ISO this is NaN. */
+ *signgamp = 0;
+ return x - x;
+ }
/* XXX FIXME. */
return __ieee754_expl (__ieee754_lgammal_r (x, signgamp));