Login     Register

        Contact Us     Search

XLeratorDB/math Documentation

SQL Server FACT function


FACT
 
Updated: 17 august 2010 
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)
Syntax
SELECT [westclintech].[wct].[FACT] (
   <@Number, float,>)
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 Types
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
Example
 
SELECT wct.FACT(10)
 
Here is the result set
----------------------
3628800
 
(1 row(s) affected)
See Also


Copyright 2008-2017 Westclintech LLC         Privacy Policy        Terms of Service