The IMSL_BINOMIALCOEF function evaluates the binomial coefficient.
This routine requires an IDL Advanced Math and Stats license. For more information, contact your sales or technical support representative.
The binomial function is defined to be:
with n ≥ m ≥ 0. Also, n must not be so large that the function overflows.
Examples
In this example:
is computed and printed.
n = 9
m = 5
ans = IMSL_BINOMIALCOEF(n, m)
PRINT, 'binomial coefficient =', ans
IDL prints:
binomial coefficient = 126.000
Syntax
Result = IMSL_BINOMIALCOEF(N, M [, /DOUBLE])
Return Value
The binomial coefficient:
is returned.
Arguments
M
Second parameter of the binomial coefficient. Argument M must be nonnegative.
N
First parameter of the binomial coefficient. Argument N must be nonnegative.
Keywords
DOUBLE (optional)
If present and nonzero, double precision is used.
Version History
See Also
IMSL_BINOMIALCDF, IMSL_BINOMIALPDF