title: Percentile calculation mismatch using apache.math3.stat.descriptive
body: <p>I am calculating the 95th percentile of the following list of numbers:</p>
  
  <pre><code>66,337.8,989.7,1134.6,1118.7,1097.9,1122.1,1121.3,1106.7,871,325.2,285.1,264.1,295.8,342.4
  </code></pre>
  
  <p>The apache libraries use the NIST standards to calculate the percentile which is the same method used by Excel. According to Excel the 95th percentile of the list above should be 1125.85.</p>
  
  <p>However, using the following code I get a different result:</p>
  
  <pre><code>DescriptiveStatistics shortList = new DescriptiveStatistics();
  
  
  
  @BeforeTest
  @Parameters("shortStatsList")
  private void buildShortStatisticsList(String list) {
      StringTokenizer tokens = new StringTokenizer(list, ",");
      while (tokens.hasMoreTokens()) {
          shortList.addValue(Double.parseDouble(tokens.nextToken()));
      }
  }
  
  @Test
  @Parameters("95thPercentileShortList")
  public void percentileShortListTest(String percentile) {
      Assert.assertEquals(Double.toString(shortList.getPercentile(95)), percentile);
  }
  </code></pre>
  
  <p>This fails with the following message:</p>
  
  <pre><code>java.lang.AssertionError: expected:&lt;1125.85&gt; but was:&lt;1134.6&gt;
  at org.testng.Assert.fail(Assert.java:89)
  at org.testng.Assert.failNotEquals(Assert.java:489)
  </code></pre>
  
  <p>1134.6 is the maximum value in the list, not the 95th percentile, so I don't know where this value is coming from.</p>