afac: Ascending (rising) factorial.

View source: R/classification.R

afacR Documentation

Ascending (rising) factorial.

Description

Calculate the ascending (or rising) factorial of a value x of order r.

Usage

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

Arguments

x

A value for which the ascending 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 descending 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 ascending factorial of value x raised to the r'th power.

Examples

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

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

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