Stat { public static double binom(int n, int i) { return 1.0 * nFactExact(n) / (nFactExact(i) * nFactExact(n - i)); }  static double hg(long D, long gt, long S); static double hgapprox(long D, long gt, int S); static double beta_CDF(double x, int a, int b); static double incompleteBeta(double x, int a, int b); static double beta(int a, int b); static double ix(double x, int a, int b); static double logNfact(long n); static long nFactExact(long n); static double binom(int n, int i); static double logBinom(int n, int i); static double logoggs(double p); static double logit(double logodds); static void main(String[] args);  }
@Test public final void testBinom() { RangePairIntInt rp = new RangePairIntInt(); rp.setRange1(5, 9); rp.setRange2(1, 4); double ress[] = {5,6,7,8,9,10,15,21,28,36,10,20,35,56,84,5,15,35,70,126}; List<ModelIntIntDouble> testData = TestDataManager.fillTestCasesIntIntDouble(rp,ress); for(ModelIntIntDouble datum : testData) { assertEquals(datum.getRes(), Stat.binom(datum.getArg1(), datum.getArg2()),TestDataManager.DELTA_DOUBLE); } }