commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l..@apache.org
Subject svn commit: r1074295 - /commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/FastMath.java
Date Thu, 24 Feb 2011 21:19:33 GMT
Author: luc
Date: Thu Feb 24 21:19:33 2011
New Revision: 1074295

URL: http://svn.apache.org/viewvc?rev=1074295&view=rev
Log:
fixed a nasty bug with atan2 that occurred only with some Java 1.5 virtual machines

Modified:
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/FastMath.java

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/FastMath.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/FastMath.java?rev=1074295&r1=1074294&r2=1074295&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/FastMath.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/FastMath.java Thu
Feb 24 21:19:33 2011
@@ -3046,8 +3046,8 @@ public class FastMath {
         rb = -(temp - ra - rb);
         ra = temp;
 
-        if (ra == 0 && (y < 0)) { // Fix up the sign so atan works correctly
-            ra = -0.0;
+        if (ra == 0) { // Fix up the sign so atan works correctly
+            ra = copySign(0.0, y);
         }
 
         // Call atan



Mime
View raw message