Logo

FACT

Updated 2023-10-13 20:12:47.627000

Syntax

SELECT [westclintech].[wct].[FACT] (
   <@Number, float,>)

Description

Use FACT to calculate the factorial of a number. The factorial of a number equal to n*(n-1)*(n-2)*(n-3)…*(n-n+1)

Arguments

@Number

is the value to calculate the 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 170.

Examples

SELECT wct.FACT(10);

Here is the result set.

{"columns":[{"field":"column 1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"column 1":"3628800"}]}

See Also

GAMMA - complete gamma function

GAMMALN - natural logarithm of the complete gamma function

FACTLN - natural logarithm of a factorial

BICO - Binomial coefficient

COMBIN - Combinatorial function

PERMUT - calculate the number of permutations for a given number objects that can be selected from a number of objects

FACTDOUBLE - Calculate the double factorial of a number.