Routine ID: B100 | |
---|---|
Author(s): K.S. Kölbig | Library: MATHLIB |
Submitter: | Submitted: 15.02.1989 |
Language: Fortran | Revised: 15.03.1993 |
Function subprograms BINOM and DBINOM calculate the binomial coefficient
| |
| |
|
for real x and integer k. Function subprogram KBINOM calculates the binomial coefficient only for integer x=n.
On CDC and Cray computers, the double-precision version DBINOM is not available.
Structure:
FUNCTION subprograms
User Entry Names: BINOM, DBINOM, KBINOM
Files Referenced: Unit 6
Usage:
In any arithmetic expression, BINOM(X,K), DBINOM(X,K) or KBINOM(N,K)
has the value of the binomial coefficient. BINOM is of type REAL, DBINOM is of type DOUBLE PRECISION and X has the same type as the function name. KBINOM, N and K are of type INTEGER.
Restrictions:
Function subprogram KBINOM can compute only binomial coefficients which lie in the integer range of the machine.
Accuracy:
Full machine accuracy.
Error handling:
If the result of KBINOM would lie outside the integer range of
the machine, KBINOM is set equal to zero and an error
message is printed.