commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From celes...@apache.org
Subject svn commit: r1414531 - /commons/proper/math/trunk/src/test/java/org/apache/commons/math3/special/GammaTest.java
Date Wed, 28 Nov 2012 05:39:40 GMT
Author: celestin
Date: Wed Nov 28 05:39:39 2012
New Revision: 1414531

URL: http://svn.apache.org/viewvc?rev=1414531&view=rev
Log:
In GammaTest: restored method checkRelativeError which was inadvertently removed in r1414527.

Modified:
    commons/proper/math/trunk/src/test/java/org/apache/commons/math3/special/GammaTest.java

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math3/special/GammaTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math3/special/GammaTest.java?rev=1414531&r1=1414530&r2=1414531&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math3/special/GammaTest.java
(original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math3/special/GammaTest.java
Wed Nov 28 05:39:39 2012
@@ -19,7 +19,6 @@ package org.apache.commons.math3.special
 import org.apache.commons.math3.TestUtils;
 import org.apache.commons.math3.exception.NumberIsTooLargeException;
 import org.apache.commons.math3.exception.NumberIsTooSmallException;
-import org.apache.commons.math3.exception.OutOfRangeException;
 import org.apache.commons.math3.util.FastMath;
 import org.junit.Assert;
 import org.junit.Test;
@@ -961,4 +960,10 @@ public class GammaTest {
             Assert.assertTrue(Integer.toString(i), Double.isNaN(Gamma.gamma(i)));
         }
     }
+
+    private void checkRelativeError(String msg, double expected, double actual,
+                                    double tolerance) {
+
+        Assert.assertEquals(msg, expected, actual, FastMath.abs(tolerance * actual));
+    }
 }



Mime
View raw message