[Scipy-svn] r3120 - trunk/Lib/special/cephes

scipy-svn@scip... scipy-svn@scip...
Thu Jun 28 03:27:13 CDT 2007


Author: cookedm
Date: 2007-06-28 03:24:55 -0500 (Thu, 28 Jun 2007)
New Revision: 3120

Modified:
   trunk/Lib/special/cephes/gamma.c
Log:
Lib/special: gamma(x) for x >~ 700 would return nan instead of inf. This fixes $53.


Modified: trunk/Lib/special/cephes/gamma.c
===================================================================
--- trunk/Lib/special/cephes/gamma.c	2007-06-28 08:23:59 UTC (rev 3119)
+++ trunk/Lib/special/cephes/gamma.c	2007-06-28 08:24:55 UTC (rev 3120)
@@ -291,6 +291,13 @@
 {
 double y, w, v;
 
+if (x >= MAXGAM) {
+#ifdef INFINITIES
+	return (INFINITY);
+#else
+	return (MAXNUM);
+#endif
+}
 w = 1.0/x;
 w = 1.0 + w * polevl( w, STIR, 4 );
 y = exp(x);



More information about the Scipy-svn mailing list