commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdigg...@apache.org
Subject cvs commit: jakarta-commons-sandbox/math/src/java/org/apache/commons/math/stat/univariate/rank Percentile.java
Date Thu, 16 Oct 2003 15:15:04 GMT
mdiggory    2003/10/16 08:15:04

  Modified:    math/src/test/org/apache/commons/math/stat/univariate/rank
                        PercentileTest.java
               math/src/java/org/apache/commons/math/stat/univariate/rank
                        Percentile.java
  Log:
  PR: http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23453
  Submitted by:	Brent Warden
  Reviewed by:	Mark Diggory
  
  Revision  Changes    Path
  1.5       +6 -1      jakarta-commons-sandbox/math/src/test/org/apache/commons/math/stat/univariate/rank/PercentileTest.java
  
  Index: PercentileTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/math/src/test/org/apache/commons/math/stat/univariate/rank/PercentileTest.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- PercentileTest.java	13 Oct 2003 08:08:39 -0000	1.4
  +++ PercentileTest.java	16 Oct 2003 15:15:04 -0000	1.5
  @@ -99,4 +99,9 @@
           return 20.82;
       }
   
  +    public void testHighPercentile(){
  +        double[] d = new double[]{1, 2, 3};
  +        Percentile p = new Percentile(75);
  +        assertEquals(3.0, p.evaluate(d), 1.0e-5);
  +    }
   }
  
  
  
  1.7       +2 -2      jakarta-commons-sandbox/math/src/java/org/apache/commons/math/stat/univariate/rank/Percentile.java
  
  Index: Percentile.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/math/src/java/org/apache/commons/math/stat/univariate/rank/Percentile.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Percentile.java	13 Oct 2003 08:10:58 -0000	1.6
  +++ Percentile.java	16 Oct 2003 15:15:04 -0000	1.7
  @@ -145,7 +145,7 @@
           if (pos < 1) {
               return sorted[0];
           }
  -        if (pos > n) {
  +        if (pos >= n) {
               return sorted[length - 1];
           }
           double lower = sorted[intPos - 1];
  
  
  

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