git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1232848 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gilles Sadowski 2012-01-18 12:00:03 +00:00
parent 27dc50b397
commit 41737b05da
1 changed files with 6 additions and 3 deletions

View File

@ -99,7 +99,8 @@ public final class ArithmeticUtils {
* @param n the size of the set * @param n the size of the set
* @param k the size of the subsets to be counted * @param k the size of the subsets to be counted
* @return {@code n choose k} * @return {@code n choose k}
* @throws MathIllegalNumberException if preconditions are not met. * @throws NotPositiveException if {@code n < 0}.
* @throws NumberIsTooLargeException if {@code k > n}.
* @throws MathArithmeticException if the result is too large to be * @throws MathArithmeticException if the result is too large to be
* represented by a long integer. * represented by a long integer.
*/ */
@ -178,7 +179,8 @@ public final class ArithmeticUtils {
* @param n the size of the set * @param n the size of the set
* @param k the size of the subsets to be counted * @param k the size of the subsets to be counted
* @return {@code n choose k} * @return {@code n choose k}
* @throws IllegalArgumentException if preconditions are not met. * @throws NotPositiveException if {@code n < 0}.
* @throws NumberIsTooLargeException if {@code k > n}.
*/ */
public static double binomialCoefficientDouble(final int n, final int k) { public static double binomialCoefficientDouble(final int n, final int k) {
ArithmeticUtils.checkBinomial(n, k); ArithmeticUtils.checkBinomial(n, k);
@ -219,7 +221,8 @@ public final class ArithmeticUtils {
* @param n the size of the set * @param n the size of the set
* @param k the size of the subsets to be counted * @param k the size of the subsets to be counted
* @return {@code n choose k} * @return {@code n choose k}
* @throws IllegalArgumentException if preconditions are not met. * @throws NotPositiveException if {@code n < 0}.
* @throws NumberIsTooLargeException if {@code k > n}.
*/ */
public static double binomialCoefficientLog(final int n, final int k) { public static double binomialCoefficientLog(final int n, final int k) {
ArithmeticUtils.checkBinomial(n, k); ArithmeticUtils.checkBinomial(n, k);