This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
tgamma infinity limit for IEEE quad prec.
authorJarkko Hietaniemi <jhi@iki.fi>
Thu, 20 Nov 2014 02:40:55 +0000 (21:40 -0500)
committerJarkko Hietaniemi <jhi@iki.fi>
Fri, 21 Nov 2014 01:27:56 +0000 (20:27 -0500)
ext/POSIX/POSIX.xs

index 1485d3d..9d41bf0 100644 (file)
@@ -829,9 +829,15 @@ static NV my_tgamma(NV x)
   }
 
   /* Third interval: [12, +Inf) */
-  if (x > 171.624) { /* XXX Too low for quad precision */
+#if LDBL_MANT_DIG == 113 /* IEEE quad prec */
+  if (x > 1755.548) {
     return NV_INF;
   }
+#else
+  if (x > 171.624) {
+    return NV_INF;
+  }
+#endif
 
   return Perl_exp(c99_lgamma(x));
 }