commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pste...@apache.org
Subject cvs commit: jakarta-commons/math/src/java/org/apache/commons/math/distribution AbstractContinuousDistribution.java
Date Sun, 30 May 2004 01:24:02 GMT
psteitz     2004/05/29 18:24:02

  Modified:    math/src/java/org/apache/commons/math/distribution
                        AbstractContinuousDistribution.java
  Log:
  Added endpoint order check to cumulativeProbability(double, double).
  
  Revision  Changes    Path
  1.22      +6 -1      jakarta-commons/math/src/java/org/apache/commons/math/distribution/AbstractContinuousDistribution.java
  
  Index: AbstractContinuousDistribution.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/math/src/java/org/apache/commons/math/distribution/AbstractContinuousDistribution.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- AbstractContinuousDistribution.java	19 May 2004 14:16:31 -0000	1.21
  +++ AbstractContinuousDistribution.java	30 May 2004 01:24:02 -0000	1.22
  @@ -46,9 +46,14 @@
        * @return the cumulative probability. 
        * @throws MathException if the cumulative probability can not be
        *            computed due to convergence or other numerical errors.
  +     * @throws IllegalArgumentException if x0 > x1
        */
       public double cumulativeProbability(double x0, double x1)
           throws MathException {
  +        if (x0 > x1) {
  +            throw new IllegalArgumentException
  +            ("lower endpoint must be less than or equal to upper endpoint");
  +        }
           return cumulativeProbability(x1) - cumulativeProbability(x0);
       }
   
  
  
  

---------------------------------------------------------------------
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