View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Loane Sharp[_2_] Loane Sharp[_2_] is offline
external usenet poster
 
Posts: 12
Default largest factorial that can be computed

Hi there

I am using the following function to calculate the factorial of a number
(53! = 53x52x51x...x1). I have three questions for you (assume I have
practically unlimited available memory):

(a) what is the largest factorial that I can compute using the most
economical datatypes?
(b) does the number in (a) differ if I reframe the computation, say, in
terms of logs?
(c) what is the largest array of 0/1 values that I can declare?

Please help!

Best regards
Loane


Public x As Long
Public facNumber As Integer
Public arrPossibilities() As Byte

[...]

Public Function Factorial(ByVal facNumber As Integer) As Long
If facNumber <= 1 Then
Factorial = 1
Else
Factorial = facNumber * Factorial(facNumber - 1)
End If
End Function 'Factorial