@Test public void testFactorial() { logger.info("factorial"); int k = 10; double expResult = 3628800.0; double result = Arithmetics.factorial(k); Assert.assertEquals(expResult, result, Constants.DOUBLE_ACCURACY_HIGH); }
public static double factorial(int k) { double factorial=1.0; while(k>0) { factorial*=k; --k; } return factorial; }
Arithmetics { public static double factorial(int k) { double factorial=1.0; while(k>0) { factorial*=k; --k; } return factorial; } }
Arithmetics { public static double factorial(int k) { double factorial=1.0; while(k>0) { factorial*=k; --k; } return factorial; }  }
Arithmetics { public static double factorial(int k) { double factorial=1.0; while(k>0) { factorial*=k; --k; } return factorial; }  static double factorial(int k); static double combination(int n, int k); }
Arithmetics { public static double factorial(int k) { double factorial=1.0; while(k>0) { factorial*=k; --k; } return factorial; }  static double factorial(int k); static double combination(int n, int k);  }