Fact Function | |
Calculate the factorial of a number.
Namespace:
XSharp.RT
Assembly:
XSharp.RT (in XSharp.RT.dll) Version: 2.21
Syntax FUNCTION Fact(
wValue AS DWORD
) AS FLOAT
public static Float Fact(
uint wValue
)
Request Example
View SourceParameters
- wValue
- Type: DWord
A positive number.
Return Value
Type:
FloatRemarks
The factorial of an integer n is computed as follows:
1Factorial(n)=n*(n-1)*(n-2) ... 3*2*1
The factorial of 0 is defined to be 1.
Examples
This example uses Fact() to compute the factorial of 5, then it verifies the result:
1? Fact(5)
2
3? 5*4*3*2*1
See Also