Class BinomialCoefficientDouble

    • Method Detail

      • value

        public static double value​(int n,
                                   int k)
        Computes the binomial coefficient.

        The largest value of n for which all coefficients can fit into a double is 1029. Larger n may result in infinity depending on the value of k.

        Any min(k, n - k) >= 515 cannot fit into a double and will result in infinity.

        Parameters:
        n - Size of the set.
        k - Size of the subsets to be counted.
        Returns:
        n choose k.
        Throws:
        IllegalArgumentException - if n < 0, k < 0 or k > n.