factorial: Function for calculating factorials using the standard...

Description Usage Arguments Value References Examples

Description

Factorials are denoted for a positive integer x as x! and are defined as:

x! = (x)(x - 1)(x - 2) \cdots (2)(1)

For example, the factorial of 5 is written as: 5! = (5)(4)(3)(2)(1) = 120

Usage

1

Arguments

n

Desired integer to compute factorial

Value

the factorial, n!, of n

References

Press, W., Teukolsky, S., Vetterling, W., & Flannery, B. (2007). Numerical recipes (3rd ed.). Cambridge: Cambridge University Press. Weisstein, Eric W. "Factorial." From MathWorld–A Wolfram Web Resource. http://mathworld.wolfram.com/Factorial.html

Examples

1
2

aschleg/numberr documentation built on May 14, 2019, 10:31 a.m.