TreeTools (version 0.1.3)

DoubleFactorial: Double Factorial

Description

Double Factorial

Usage

DoubleFactorial(n)

LogDoubleFactorial(n)

LogDoubleFactorial.int(n)

Arguments

n

Vector of integers.

Value

Returns the double factorial, n x (n - 2) x (n - 4) x (n - 6) x ...

Functions

  • LogDoubleFactorial: Returns the logarithm of the double factorial.

  • LogDoubleFactorial.int: Slightly faster, when x is known to be length one and below 50001

See Also

Other Double factorial: doubleFactorials, logDoubleFactorials

Examples

Run this code
# NOT RUN {
{
DoubleFactorial (-4:0) # Return 1 if n < 2
DoubleFactorial (2) # 2
DoubleFactorial (5) # 1 x 3 x 5
exp(LogDoubleFactorial.int (8)) # 2 x 4 x 6 x 8

}

# }

Run the code above in your browser using DataLab