binomial_coefficient_r Function

public pure function binomial_coefficient_r(n, k)

Computes binomial coefficient n over k Returns -1 for invalid input, i.e. n or k < 0 or k > n

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n

Top number of binomal coefficient

integer, intent(in) :: k

Bottom number of binomal coefficient

Return Value real(kind=fp)