! - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


!

compute factorial

factorial

compute factorial

doublefactorial

compute double factorial

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

m!

factorial(m)

doublefactorial(n)

Parameters

m

-

expression, not a negative integer

n

-

integer greater than or equal to −1

Description

• 

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 );

doublefactorialn=2n22π14cosπn4n2!,with no restrictions on n

(1)
  

When n is a positive integer, this definition is equivalent to the product:

• 

 nn2...642 if n is an even, positive integer

• 

 nn2...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.

Examples

5!=Γ6

120=120

(2)

3.5!

11.63172840

(3)

m!

m!

(4)

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

(5)

3.I!

0.019292758960.03389601054I

(6)

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.

doublefactorial5

15

(7)

5!!

6689502913449127057588118054090372586752746333138029810295671352301633557244962989366874165271984981308157637893214090552534408589408121859898481114389650005964960521256960000000000000000000000000000

(8)

doublefactorial10

3840

(9)

doublefactorial7

115

(10)

doublefactorial1.+2.I

3.636406167×10−14+4.100313151×10−14I

(11)

The 0th operand of m! is factorial.

typem!,function

true

(12)

typem!,`!`

true

(13)

op0,m!

factorial

(14)

See Also

binomial

Command-line Edit History

convert

escape

FunctionAdvisor

GAMMA

initialfunctions

type/factorial