Example #1
0
        public static double binomialCoefficientLn(int n, int k)
        {
            if (!(n >= k))
            {
                throw new Exception("n<k not allowed");
            }

            return(Factorial.ln(n) - Factorial.ln(k) - Factorial.ln(n - k));
        }
Example #2
0
 public static double binomialCoefficientLn(int n, int k)
 {
     QL_REQUIRE(n >= k, () => "n<k not allowed");
     return(Factorial.ln(n) - Factorial.ln(k) - Factorial.ln(n - k));
 }