Min extends AbstractStorelessUnivariateStatistic implements Serializable { @Override public double evaluate(final double[] values,final int begin, final int length) throws MathIllegalArgumentException { double min = Double.NaN; if (test(values, begin, length)) { min = values[begin]; for (int i = begin; i < begin + length; i++) { if (!Double.isNaN(values[i])) { min = (min < values[i]) ? min : values[i]; } } } return min; } Min();  Min(Min original); @Override void increment(final double d); @Override void clear(); @Override double getResult(); long getN(); @Override double evaluate(final double[] values,final int begin, final int length); @Override Min copy(); static void copy(Min source, Min dest);  }
@Test public void testNaNs() { Min min = new Min(); double nan = Double.NaN; Assert.assertEquals(2d, min.evaluate(new double[]{nan, 2d, 3d}), 0); Assert.assertEquals(1d, min.evaluate(new double[]{1d, nan, 3d}), 0); Assert.assertEquals(1d, min.evaluate(new double[]{1d, 2d, nan}), 0); Assert.assertTrue(Double.isNaN(min.evaluate(new double[]{nan, nan, nan}))); }