commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From er...@apache.org
Subject svn commit: r1369514 - /commons/proper/math/trunk/src/test/java/org/apache/commons/math3/util/FastMathTestPerformance.java
Date Sun, 05 Aug 2012 02:37:16 GMT
Author: erans
Date: Sun Aug  5 02:37:15 2012
New Revision: 1369514

URL: http://svn.apache.org/viewvc?rev=1369514&view=rev
Log:
MATH-840
Fixed invalid argument to "asin" and "acos".

Modified:
    commons/proper/math/trunk/src/test/java/org/apache/commons/math3/util/FastMathTestPerformance.java

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math3/util/FastMathTestPerformance.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math3/util/FastMathTestPerformance.java?rev=1369514&r1=1369513&r2=1369514&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math3/util/FastMathTestPerformance.java
(original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math3/util/FastMathTestPerformance.java
Sun Aug  5 02:37:15 2012
@@ -209,19 +209,19 @@ public class FastMathTestPerformance {
         double x = 0;
         long time = System.nanoTime();
         for (int i = 0; i < RUNS; i++)
-            x += StrictMath.asin(i / 10000000.0);
+            x += StrictMath.asin(i / (double) RUNS);
         long strictTime = System.nanoTime() - time;
 
         x = 0;
         time = System.nanoTime();
         for (int i = 0; i < RUNS; i++)
-            x += FastMath.asin(i / 10000000.0);
+            x += FastMath.asin(i / (double) RUNS);
         long fastTime = System.nanoTime() - time;
 
         x = 0;
         time = System.nanoTime();
         for (int i = 0; i < RUNS; i++)
-            x += Math.asin(i / 10000000.0);
+            x += Math.asin(i / (double) RUNS);
         long mathTime = System.nanoTime() - time;
 
         report("asin",strictTime,fastTime,mathTime);
@@ -257,19 +257,19 @@ public class FastMathTestPerformance {
         double x = 0;
         long time = System.nanoTime();
         for (int i = 0; i < RUNS; i++)
-            x += StrictMath.acos(i / 10000000.0);
+            x += StrictMath.acos(i / (double) RUNS);
         long strictTime = System.nanoTime() - time;
 
         x = 0;
         time = System.nanoTime();
         for (int i = 0; i < RUNS; i++)
-            x += FastMath.acos(i / 10000000.0);
+            x += FastMath.acos(i / (double) RUNS);
         long fastTime = System.nanoTime() - time;
 
         x = 0;
         time = System.nanoTime();
         for (int i = 0; i < RUNS; i++)
-            x += Math.acos(i / 10000000.0);
+            x += Math.acos(i / (double) RUNS);
         long mathTime = System.nanoTime() - time;
         report("acos",strictTime,fastTime,mathTime);
         Assert.assertTrue(!Double.isNaN(x));



Mime
View raw message