IMSL_BINOMIALCOEF

Syntax | Return Value | Arguments | Keywords | Discussion | Example | Version History

The IMSL_BINOMIALCOEF function evaluates the binomial coefficient.

Note
This routine requires an IDL Advanced Math and Stats license. For more information, contact your ITT Visual Information Solutions sales or technical support representative.

Syntax

Result = IMSL_BINOMIALCOEF(n, m [, /DOUBLE])

Return Value

The binomial coefficient:

IMSL_BINOMIALCOEF-16.jpg

is returned.

Arguments

m

Second parameter of the binomial coefficient. Parameter m must be nonnegative.

n

First parameter of the binomial coefficient. Parameter n must be nonnegative.

Keywords

DOUBLE

If present and nonzero, double precision is used.

Discussion

The binomial function is defined to be:

IMSL_BINOMIALCOEF-17.jpg

with nm ≥ 0. Also, n must not be so large that the function overflows.

Example

In this example:

IMSL_BINOMIALCOEF-18.jpg

is computed and printed.

n  =  9 
m  =  5 
ans  =  IMSL_BINOMIALCOEF(n, m) 
PRINT,  'binomial coefficient =', ans 
 
binomial coefficient =      126.000 

Version History

6.4

Introduced