You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by br...@apache.org on 2005/08/23 05:04:10 UTC

svn commit: r239305 - in /jakarta/commons/proper/math/branches/MATH_1_1: src/java/org/apache/commons/math/analysis/UnivariateRealSolverImpl.java xdocs/changes.xml

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