dfac: Descending (falling) factorial.

View source: R/classification.R

dfacR Documentation

Descending (falling) factorial.

Description

Calculate the descending (or falling) factorial of a value x of order r.

Usage

dfac(x, r, method = "product")

Arguments

x

A value for which the descending factorial is to be calculated.

r

The power x is to be raised to.

method

The method by which the descending factorials are to be calculated. Default is "product" which uses direct arithmetic. Alternative is "gamma" which calculates the ascending factorial using the Gamma function. The alternative method might be faster but might fail because the Gamma function is not defined for negative integers (returning Inf).

Value

The descending factorial of value x raised to the r'th power.

Examples

# To calculate the 4th descending factorial for a value (e.g., 3.14):
dfac(x = 3.14, r = 4)

# To calculate the 5th descending factorial for values 3.14, 2.72, and 0.58:
dfac(x = c(3.14, 2.72, 0.58), r = 5)

betafunctions documentation built on May 29, 2024, 1:13 a.m.