about summary refs log tree commit diff
path: root/sysdeps/ieee754/ldbl-128/e_lgammal_r.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/ieee754/ldbl-128/e_lgammal_r.c')
-rw-r--r--sysdeps/ieee754/ldbl-128/e_lgammal_r.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sysdeps/ieee754/ldbl-128/e_lgammal_r.c b/sysdeps/ieee754/ldbl-128/e_lgammal_r.c
index 23ab9b9a43..1961355a73 100644
--- a/sysdeps/ieee754/ldbl-128/e_lgammal_r.c
+++ b/sysdeps/ieee754/ldbl-128/e_lgammal_r.c
@@ -805,7 +805,9 @@ __ieee754_lgammal_r (long double x, int *signgamp)
 	{
 	case 0:
 	  /* log gamma (x + 1) = log(x) + log gamma(x) */
-	  if (x <= 0.125)
+	  if (x < 0x1p-120L)
+	    return -__logl (x);
+	  else if (x <= 0.125)
 	    {
 	      p = x * neval (x, RN1, NRN1) / deval (x, RD1, NRD1);
 	    }