FACTDOUBLE

Chandra Bergmann

The FACTDOUBLE function returns the double factorial of a given Number.

This function takes a single Number as input. It outputs that Number's double factorial. In other words, given some Number n, FACTDOUBLE returns $$n!! = \prod^{n/2 -1}_{k=0} (n-2k)$$.

Declaration

FACTDOUBLE(n) -> double_factorial

Parameters

n (required, type: Number)
The number for which you want to calculate the double factorial.

Return Values

double_factorial (type: Number)
The double factorial of the given Number n. In more mathematical terms, $$n!! = \prod^{n/2 -1}_{k=0} (n-2k)$$

Examples

The following example returns the double factorial of 6, or $$6 \cdot 4 \cdot 2$$:

FACTDOUBLE(6) -> 48

The following example returns the double factorial of 7, or $$7 \cdot 5 \cdot 3 \cdot 1$$:

FACTDOUBLE(7) -> 105
If given a non-integer Number as input, the FACTDOUBLE function will return the double factorial of the given number rounded down to the nearest integer. In the following example, FACTDOUBLE is given the number 7.9 as input, and it returns the double factorial of 7, or $$7 \cdot 5 \cdot 3 \cdot 1$$:
FACTDOUBLE(7.9) -> 105

If given a Number less than one as input, the FACTDOUBLE function will return the Number 1. In the following example, the FACTDOUBLE function is given the number 0.9 as input, and it returns 1:

FACTDOUBLE(0.9) -> 1

FACTDOUBLE will return the same output if given an negative number as input, such as in the following example:

FACTDOUBLE(-6) -> 1