Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 86
Default largest factorial that can be computed

You can calculate very large factorials with limited accuracy.

Be careful.

Excel integer math only handles 15 digits. After around 17! you will reach
that limit.
--
Gary's Student


"Loane Sharp" wrote:

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




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default largest factorial that can be computed

Loane Sharp wrote:
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

----------------------------------

If you mean by using Excel's built in functions as in your code (multiply for
example) then it only carries a limited number of digits -- 14 or 15. As an
example, start computing your factorials, and check each one by dividing back to
see if you get the previous factorial. When you don't anymore, then you've hit
the limits of Excel's built in functions.

On the other hand if you have a penchant for doing this problem in Excel VBA
which belongs in some other more speedy programming language, you can manually
create your own million+ bit long integer (using arrays of shorter integers) and
write your own multiply and convert to decimal routines, and you can sit around
waiting eons (literally) for execution, then you can compute just about any
factorial you want.

But why would one want to? Time is more of a limitation than anything given
enough programming effort. Given a million years or so you could compute a heck
of a big factorial.

Good luck...

Bill
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default largest factorial that can be computed

Does this help ?
http://www.big-numbers.com/

NickHK

"Loane Sharp" wrote in message
...
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





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Factorial question M.M Excel Worksheet Functions 6 June 8th 09 04:33 PM
Factorial Listing Branson Excel Discussion (Misc queries) 3 June 6th 08 04:18 PM
Factorial (like =FACT) function? mr tom Excel Worksheet Functions 8 June 13th 06 01:45 AM
Range of Factorial Function Rushi Excel Discussion (Misc queries) 7 September 17th 05 12:28 AM
Help? Inverse factorial? 43fan Excel Programming 5 December 30th 03 06:25 PM


All times are GMT +1. The time now is 09:58 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"