You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by lu...@apache.org on 2011/02/24 22:18:59 UTC

svn commit: r1074294 - /commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/util/FastMath.java

Author: luc
Date: Thu Feb 24 21:18:59 2011
New Revision: 1074294

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

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

Modified: commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/util/FastMath.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/util/FastMath.java?rev=1074294&r1=1074293&r2=1074294&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/util/FastMath.java (original)
+++ commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/util/FastMath.java Thu Feb 24 21:18:59 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