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/test/org/apache/commons/math/stat/univariate/moment StandardDeviationTest.java
Date Sat, 26 Jun 2004 22:42:37 GMT
psteitz     2004/06/26 15:42:37

  Modified:    math/src/test/org/apache/commons/math/stat/univariate/moment
                        StandardDeviationTest.java
  Log:
  Added test to ensure NaN is returned for n=0, and 0 for n=1.
  
  Revision  Changes    Path
  1.12      +12 -1     jakarta-commons/math/src/test/org/apache/commons/math/stat/univariate/moment/StandardDeviationTest.java
  
  Index: StandardDeviationTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/math/src/test/org/apache/commons/math/stat/univariate/moment/StandardDeviationTest.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- StandardDeviationTest.java	17 Jun 2004 21:37:05 -0000	1.11
  +++ StandardDeviationTest.java	26 Jun 2004 22:42:37 -0000	1.12
  @@ -56,5 +56,16 @@
       public double expectedValue() {
           return this.std;
       }
  +    
  +    /**
  +     * Make sure Double.NaN is returned iff n = 0
  +     *
  +     */
  +    public void testNaN() {
  +        StandardDeviation std = new StandardDeviation();
  +        assertTrue(Double.isNaN(std.getResult()));
  +        std.increment(1d);
  +        assertEquals(0d, std.getResult(), 0);
  +    }
   
   }
  
  
  

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