myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r1781307 - /myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/layout/MathUtils.java
Date Wed, 01 Feb 2017 21:00:09 GMT
Author: deki
Date: Wed Feb  1 21:00:09 2017
New Revision: 1781307

URL: http://svn.apache.org/viewvc?rev=1781307&view=rev
Log:
Equality tests should not be made with floating point values

Modified:
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/layout/MathUtils.java

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/layout/MathUtils.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/layout/MathUtils.java?rev=1781307&r1=1781306&r2=1781307&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/layout/MathUtils.java
(original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/layout/MathUtils.java
Wed Feb  1 21:00:09 2017
@@ -72,7 +72,7 @@ public final class MathUtils {
     Integer indexOfMin = null;
     for (int i = 0; i < list.length; i++) {
       final double remainder = remainder(list[i]);
-      if (remainder == 0) { // is zero
+      if (Double.compare(remainder, 0) == 0) { // is zero
         continue;
       }
       if (remainder < min - EPSILON) {



Mime
View raw message