SQL Server FACTDOUBLE Function
Updated 2023-10-13 20:17:04.023000
Description
Use the scalar function FACTDOUBLE to calculate the double factorial of a number. The double factorial of a number is equal to n*(n-1)*(n-2)…*(n-i) where n-i greater than 2
Syntax
SELECT [westclintech].[wct].[FACTDOUBLE] (
<@Number, float,>)
Arguments
@Number
is the value to calculate the double factorial of. @Number is an expression of type float or of a type that can be implicitly converted to float.
Return Type
float
Remarks
@Number is truncated to an integer.
@Number must be greater than or equal to 0.
@Number must be less than or equal to 300.
Examples
SELECT wct.FACTDOUBLE(13);
Here is the result set.
| column 1 |
|---|
| 135135 |