Documentation/Calc Functions/FACTDOUBLE

    From The Document Foundation Wiki
    Other languages:


    Function name:

    FACTDOUBLE

    Category:

    Add-in

    Summary:

    Calculates the double factorial of a non-negative integer value. If n is an even positive integer, its double factorial is the product of all even integers in the range [2, n]; if n is an odd positive integer, its double factorial is the product of all odd integers in the range [1, n]. The double factorial of n is usually denoted by n!!.

    Syntax:

    FACTDOUBLE(Number)

    Returns:

    Returns a positive integer, which is the double factorial of the supplied number.

    Arguments:

    Number is a non-negative integer, or a reference to the cell containing that integer, whose double factorial value is to be calculated.

    • If Number is non-numeric, then FACTDOUBLE reports a #VALUE! error.
    • If Number is a non-integer value, then FACTDOUBLE truncates it to an integer.
    • If, after any truncation, Number is less than 0 or greater than 300, then FACTDOUBLE reports an invalid argument error (Err:502).

    Additional details:

    By definition FACTDOUBLE(0) = 1.

    For an even positive integer ne:

    [math]\displaystyle{ \text{FACTDOUBLE}(n_e)~=~n_e\times(n_e-2)\times(n_e-4)\times...\times\:4\:\times\:2 }[/math]

    For an odd positive integer no:

    [math]\displaystyle{ \text{FACTDOUBLE}(n_o)~=~n_o\times(n_o-2)\times(n_o-4)\times...\times\:3\:\times\:1 }[/math]

    More information can be found at Wikipedia's Double factorial page.

    Examples:

    Formula Description Returns
    =FACTDOUBLE(1) Here the function calculates 1!!, returning the value 1. 1
    =FACTDOUBLE(2) Here the function calculates 2!!, returning the value 2. 2
    =FACTDOUBLE(3) Here the function calculates 3!!, returning the value 3 (3 * 1). 3
    =FACTDOUBLE(4) Here the function calculates 4!!, returning the value 8 (4 * 2). 8
    =FACTDOUBLE(5) Here the function calculates 5!!, returning the value 15 (5 * 3 * 1). 15
    =FACTDOUBLE(6) Here the function calculates 6!!, returning the value 48 (6 * 4 * 2). 48
    =FACTDOUBLE(7) Here the function calculates 7!!, returning the value 105 (7 * 5 * 3 * 1). 105
    =FACTDOUBLE(D1) where cell D1 contains the value 8. Here the function calculates 8!!, returning the value 384 (8 * 6 * 4 * 2). 384

    Related LibreOffice functions:

    FACT

    GAMMA

    ODF standard:

    Section 6.16.33, part 2

    Related (or similar) Excel functions:

    FACTDOUBLE