Evaluates the binomial coefficient.
#include <imsls.h>
float imsls_f_binomial_coefficient (int n, int m)
The type double procedure is imsls_d_binomial_coefficient.
int n
(Input)
First parameter of the binomial coefficient. Argument n must be
nonnegative.
int m
(Input)
Second parameter of the binomial coefficient. Argument m must be
nonnegative.
The binomial coefficient
is returned.
The binomial function is defined to be
with n ≥ m ≥ 0. Also, n must not be so large that the function overflows.
In this example, is computed and printed.
#include <stdio.h>
#include <imsls.h>
int main()
{
int n = 9;
int m = 5;
float ans;
ans = imsls_f_binomial_coefficient(n, m);
printf("binomial coefficient = %.1f\n", ans);
}
binomial coefficient = 126.0
Visual Numerics, Inc. PHONE: 713.784.3131 FAX:713.781.9260 |