commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l..@apache.org
Subject svn commit: r992595 - /commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/optimization/univariate/AbstractUnivariateRealOptimizer.java
Date Sat, 04 Sep 2010 13:10:25 GMT
Author: luc
Date: Sat Sep  4 13:10:25 2010
New Revision: 992595

URL: http://svn.apache.org/viewvc?rev=992595&view=rev
Log:
replacing non-working equality test with NaN by a call to Double.isNaN()
NaNs have the strange property that they can be compared to nothing, they are not event equal
to themselves!

Modified:
    commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/optimization/univariate/AbstractUnivariateRealOptimizer.java

Modified: commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/optimization/univariate/AbstractUnivariateRealOptimizer.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/optimization/univariate/AbstractUnivariateRealOptimizer.java?rev=992595&r1=992594&r2=992595&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/optimization/univariate/AbstractUnivariateRealOptimizer.java
(original)
+++ commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/optimization/univariate/AbstractUnivariateRealOptimizer.java
Sat Sep  4 13:10:25 2010
@@ -101,7 +101,7 @@ public abstract class AbstractUnivariate
 
     /** {@inheritDoc} */
     public double getFunctionValue() {
-        if (functionValue == Double.NaN) {
+        if (Double.isNaN(functionValue)) {
             final double opt = getResult();
             try {
                 functionValue = function.value(opt);



Mime
View raw message