commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brentwor...@apache.org
Subject svn commit: r239305 - in /jakarta/commons/proper/math/branches/MATH_1_1: src/java/org/apache/commons/math/analysis/UnivariateRealSolverImpl.java xdocs/changes.xml
Date Tue, 23 Aug 2005 03:04:10 GMT
Author: brentworden
Date: Mon Aug 22 20:04:07 2005
New Revision: 239305

URL: http://svn.apache.org/viewcvs?rev=239305&view=rev
Log:
PR 36232: Added protection against numerical overflow and underflow in the isBracketing method.

Modified:
    jakarta/commons/proper/math/branches/MATH_1_1/src/java/org/apache/commons/math/analysis/UnivariateRealSolverImpl.java
    jakarta/commons/proper/math/branches/MATH_1_1/xdocs/changes.xml

Modified: jakarta/commons/proper/math/branches/MATH_1_1/src/java/org/apache/commons/math/analysis/UnivariateRealSolverImpl.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/math/branches/MATH_1_1/src/java/org/apache/commons/math/analysis/UnivariateRealSolverImpl.java?rev=239305&r1=239304&r2=239305&view=diff
==============================================================================
--- jakarta/commons/proper/math/branches/MATH_1_1/src/java/org/apache/commons/math/analysis/UnivariateRealSolverImpl.java
(original)
+++ jakarta/commons/proper/math/branches/MATH_1_1/src/java/org/apache/commons/math/analysis/UnivariateRealSolverImpl.java
Mon Aug 22 20:04:07 2005
@@ -265,7 +265,9 @@
      */
     protected boolean isBracketing(double lower, double upper, 
             UnivariateRealFunction f) throws FunctionEvaluationException {
-        return  (f.value(lower) * f.value(upper) < 0);
+    	double f1 = f.value(lower);
+    	double f2 = f.value(upper);
+    	return ((f1 > 0 && f2 < 0) || (f1 < 0 && f2 > 0));
     }
     
     /**

Modified: jakarta/commons/proper/math/branches/MATH_1_1/xdocs/changes.xml
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/math/branches/MATH_1_1/xdocs/changes.xml?rev=239305&r1=239304&r2=239305&view=diff
==============================================================================
--- jakarta/commons/proper/math/branches/MATH_1_1/xdocs/changes.xml (original)
+++ jakarta/commons/proper/math/branches/MATH_1_1/xdocs/changes.xml Mon Aug 22 20:04:07 2005
@@ -45,6 +45,9 @@
        and numerical utilities, and a PRNG pluggability framework making it
        possible to replace the JDK-supplied random number generator in
        commons-math (and elsewhere) with alternative PRNG implementations.">
+	  <action dev="brentworden" type="fix" issue="36232" due-to="Xiaogang Zhang">
+		Added protection against numerical overflow and underflow in the isBracketing method.
+	  </action>
 	  <action dev="brentworden" type="fix" issue="36300" due-to="Nikhil Gupte">
 		Fixed division by zero error in rounding methods.
 	  </action>



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message