|
|
|
Click here to copy the following block |
Function Factorial(ByVal number As Long) As Double Static result(170) As Double If result(0) = 0 Then Dim i As Long result(0) = 1 For i = 1 To 170 result(i) = result(i - 1) * i Next End If Factorial = result(number) End Function
Function Factorial(ByVal N As Integer) As Variant Static Result(170) As Variant Dim X As Integer If Result(0) = 0 Then Result(0) = CDec(1) For X = 1 To 170 If X = 28 Then Result(28) = 28 * CDbl(Result(27)) Else Result(X) = X * Result(X - 1) End If Next End If Factorial = Result(N) End Function |
|
|
|
Submitted By :
Nayan Patel
(Member Since : 5/26/2004 12:23:06 PM)
|
|
|
Job Description :
He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting. |
View all (893) submissions by this author
(Birth Date : 7/14/1981 ) |
|
|