+ Reply to Thread
Results 1 to 8 of 8

Range of Factorial Function

  1. #1
    Rushi
    Guest

    Range of Factorial Function

    Hi,

    For some analysis I am doing, I tried the following LOG(FACT(229)), and it
    returned NUM!. I am wondering if 229 is too big a number to compute a
    Factorial of ? If so, is there an upper limit (something like FACT function
    can be applied for numbers <= 150) for the FACT function ?

    Thanks in anticipation,

    Rushi Patel

  2. #2
    Ian
    Guest

    Re: Range of Factorial Function

    A little experimantation reveals that FACT(170) is the largest possible,
    returning a value of 7.2574E+306.


    --
    Ian
    --
    "Rushi" <Rushi@discussions.microsoft.com> wrote in message
    news:9A23F286-6249-4107-95BF-0E7ACE92E2AC@microsoft.com...
    > Hi,
    >
    > For some analysis I am doing, I tried the following LOG(FACT(229)), and it
    > returned NUM!. I am wondering if 229 is too big a number to compute a
    > Factorial of ? If so, is there an upper limit (something like FACT
    > function
    > can be applied for numbers <= 150) for the FACT function ?
    >
    > Thanks in anticipation,
    >
    > Rushi Patel




  3. #3
    Dana DeLouis
    Guest

    Re: Range of Factorial Function

    Hi. 229! has 443 digits in it, so it's too big for both the worksheet and
    vba. (27! being the max in Vba)
    Here's just one workaround:

    Function LogFactorial(n) As Double
    Dim ans As Double
    Dim j As Long
    For j = 1 To n
    ans = ans + Log(j)
    Next j
    LogFactorial = ans
    End Function

    Test:
    ? LogFactorial(229)
    1018.95850224969

    Which checks with another program:

    Log[229!]
    1018.9585022496902

    HTH ;>)
    --
    Dana DeLouis
    Win XP & Office 2003


    "Rushi" <Rushi@discussions.microsoft.com> wrote in message
    news:9A23F286-6249-4107-95BF-0E7ACE92E2AC@microsoft.com...
    > Hi,
    >
    > For some analysis I am doing, I tried the following LOG(FACT(229)), and it
    > returned NUM!. I am wondering if 229 is too big a number to compute a
    > Factorial of ? If so, is there an upper limit (something like FACT
    > function
    > can be applied for numbers <= 150) for the FACT function ?
    >
    > Thanks in anticipation,
    >
    > Rushi Patel




  4. #4
    TomHinkle
    Guest

    Re: Range of Factorial Function

    Ian's experimentation is consistant with the range of a double precision
    floating point numer (what excel uses for calculating values)

    lol.. sounds like you need a cray!!

    Double Data Type


    Double (double-precision floating-point) variables are stored as IEEE 64-bit
    (8-byte) floating-point numbers ranging in value from -1.79769313486231E308
    to -4.94065645841247E-324 for negative values and from 4.94065645841247E-324
    to 1.79769313486232E308 for positive values. The type-declaration character
    for Double is the number sign (#).


    "Ian" wrote:

    > A little experimantation reveals that FACT(170) is the largest possible,
    > returning a value of 7.2574E+306.
    >
    >
    > --
    > Ian
    > --
    > "Rushi" <Rushi@discussions.microsoft.com> wrote in message
    > news:9A23F286-6249-4107-95BF-0E7ACE92E2AC@microsoft.com...
    > > Hi,
    > >
    > > For some analysis I am doing, I tried the following LOG(FACT(229)), and it
    > > returned NUM!. I am wondering if 229 is too big a number to compute a
    > > Factorial of ? If so, is there an upper limit (something like FACT
    > > function
    > > can be applied for numbers <= 150) for the FACT function ?
    > >
    > > Thanks in anticipation,
    > >
    > > Rushi Patel

    >
    >
    >


  5. #5
    Dana DeLouis
    Guest

    Re: Range of Factorial Function

    Oops. Didn't even think of this:

    =GAMMALN(229+1)

    1018.95850224964

    HTH :>)
    --
    Dana DeLouis
    Win XP & Office 2003


    "Dana DeLouis" <delouis@bellsouth.net> wrote in message
    news:OsRrjksuFHA.3500@TK2MSFTNGP09.phx.gbl...
    > Hi. 229! has 443 digits in it, so it's too big for both the worksheet and
    > vba. (27! being the max in Vba)
    > Here's just one workaround:
    >
    > Function LogFactorial(n) As Double
    > Dim ans As Double
    > Dim j As Long
    > For j = 1 To n
    > ans = ans + Log(j)
    > Next j
    > LogFactorial = ans
    > End Function
    >
    > Test:
    > ? LogFactorial(229)
    > 1018.95850224969
    >
    > Which checks with another program:
    >
    > Log[229!]
    > 1018.9585022496902
    >
    > HTH ;>)
    > --
    > Dana DeLouis
    > Win XP & Office 2003
    >
    >
    > "Rushi" <Rushi@discussions.microsoft.com> wrote in message
    > news:9A23F286-6249-4107-95BF-0E7ACE92E2AC@microsoft.com...
    >> Hi,
    >>
    >> For some analysis I am doing, I tried the following LOG(FACT(229)), and
    >> it
    >> returned NUM!. I am wondering if 229 is too big a number to compute a
    >> Factorial of ? If so, is there an upper limit (something like FACT
    >> function
    >> can be applied for numbers <= 150) for the FACT function ?
    >>
    >> Thanks in anticipation,
    >>
    >> Rushi Patel

    >
    >




  6. #6
    Bernie Deitrick
    Guest

    Re: Range of Factorial Function

    Since he wanted LOG not LN,

    =GAMMALN(229+1)/LN(10)

    Bernie

    > Oops. Didn't even think of this:


    I'm impressed....



  7. #7
    Jay
    Guest

    Re: Range of Factorial Function

    > For some analysis I am doing, I tried the following LOG(FACT(229)),
    > and it returned NUM!. I am wondering if 229 is too big a number to
    > compute a Factorial of ? If so, is there an upper limit (something
    > like FACT function can be applied for numbers <= 150) for the FACT
    > function ?



    Recall that LOG(A*B) = LOG(A) + LOG(B)

    So LOG(FACT(229)) = LOG(1)+LOG(2)+...+LOG(229)

    In A1:A229, put
    =LOG(ROW())

    Then in B2 put
    =SUM(A:A)

  8. #8
    Dana DeLouis
    Guest

    Re: Range of Factorial Function

    A 1-Cell entry along this same theme might be something like this:

    =SUMPRODUCT(LOG(ROW(INDIRECT("1:229"))))

    --
    Dana DeLouis
    Win XP & Office 2003


    "Jay" <itsjay_97plus1_DoTheMath@yahoo.com> wrote in message
    news:Xns96D3A5290F809qwertyuioplkjhgfdsa@207.46.248.16...
    >> For some analysis I am doing, I tried the following LOG(FACT(229)),
    >> and it returned NUM!. I am wondering if 229 is too big a number to
    >> compute a Factorial of ? If so, is there an upper limit (something
    >> like FACT function can be applied for numbers <= 150) for the FACT
    >> function ?

    >
    >
    > Recall that LOG(A*B) = LOG(A) + LOG(B)
    >
    > So LOG(FACT(229)) = LOG(1)+LOG(2)+...+LOG(229)
    >
    > In A1:A229, put
    > =LOG(ROW())
    >
    > Then in B2 put
    > =SUM(A:A)




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1