Previous IDL Analyst Reference Guide: Math and Statistics Utilities Next

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 Analyst 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:

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:

with n ³ m ³ 0. Also, n must not be so large that the function overflows.

Example

In this example:

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

  IDL Online Help (March 06, 2007)