commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From celes...@apache.org
Subject svn commit: r1376835 - /commons/proper/math/trunk/src/main/java/org/apache/commons/math3/special/Gamma.java
Date Fri, 24 Aug 2012 06:23:34 GMT
Author: celestin
Date: Fri Aug 24 06:23:34 2012
New Revision: 1376835

URL: http://svn.apache.org/viewvc?rev=1376835&view=rev
Log:
In Gamma.logGamma, replaced local variable g with class variable LANCZOS_G.

Modified:
    commons/proper/math/trunk/src/main/java/org/apache/commons/math3/special/Gamma.java

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/special/Gamma.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/special/Gamma.java?rev=1376835&r1=1376834&r2=1376835&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/special/Gamma.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/special/Gamma.java Fri
Aug 24 06:23:34 2012
@@ -95,9 +95,8 @@ public class Gamma {
         if (Double.isNaN(x) || (x <= 0.0)) {
             ret = Double.NaN;
         } else {
-            double g = 607.0 / 128.0;
             double sum = lanczos(x);
-            double tmp = x + g + .5;
+            double tmp = x + LANCZOS_G + .5;
             ret = ((x + .5) * FastMath.log(tmp)) - tmp +
                 HALF_LOG_2_PI + FastMath.log(sum / x);
         }



Mime
View raw message