!
compute factorial
factorial
doublefactorial
compute double factorial
Calling Sequence
Parameters
Description
Examples
m!
factorial(m)
doublefactorial(n)
m
-
expression, not a negative integer
n
integer greater than or equal to −1
The m! and factorial(m) commands return the factorial of m.
If m is a positive integer, Maple returns the product of the numbers from 1 to m. If m is 0 (zero), Maple returns 1 (one).
If m is a (real or complex) floating-point number, Maple returns the generalized factorial function result calculated using GAMMA(m+1).
If m is a negative integer, Maple returns an error.
The doublefactorial(n) command returns the double factorial of n, defined in terms of the generalized factorial as
FunctionAdvisor( definition, doublefactorial );
doublefactorial⁡n=2n2⁢2π14−cos⁡π⁢n4⁢n2!,with no restrictions on ⁡n
When n is a positive integer, this definition is equivalent to the product:
n⁡n−2...642 if n is an even, positive integer
n⁡n−2...531 if n is an odd, positive integer
Note: In Maple, !! is used for repeated factorials and so it does not indicate the double factorial.
The type function perceives the factorial function as of type function and as of type "!", while it perceives doublefactorial as of type function only.
The internal representation of an unevaluated factorial uses the standard representation of functions, with the function name factorial. Thus to the op function, the 0th operand of m! is factorial.
5!=Γ⁡6
120=120
3.5!
11.63172840
m!
The factorial of a negative integer cannot be calculated. The function GAMMA(m+1) is used to calculate the factorial of a floating point number, real or complex.
−2!
Error, numeric exception: division by zero
−2.1!
9.714806383
−3.⁢I!
0.01929275896−0.03389601054⁢I
The doublefactorial(n) command is not the same as !!. There are no restrictions on the value of n because of the way the function is defined.
doublefactorial⁡5
15
5!!
6689502913449127057588118054090372586752746333138029810295671352301633557244962989366874165271984981308157637893214090552534408589408121859898481114389650005964960521256960000000000000000000000000000
doublefactorial⁡10
3840
doublefactorial⁡−7
−115
doublefactorial⁡1.+2.⁢I
3.636406167×10−14+4.100313151×10−14⁢I
The 0th operand of m! is factorial.
type⁡m!,function
true
type⁡m!,`!`
op⁡0,m!
See Also
binomial
Command-line Edit History
convert
escape
FunctionAdvisor
GAMMA
initialfunctions
type/factorial
Download Help Document