Search:

Type: Posts; User: helloworld922

Search: Search took 0.11 seconds.

  1. Replies
    5
    Views
    2,246

    Re: Factorial calculation optimization

    Here's something I just thought of:

    One of the key tricks we're taking advantage of is by only keeping track of the last 5 digits for multiplication. Even with 1 trillion factorial we're going to...
  2. Replies
    5
    Views
    2,246

    Re: Factorial calculation optimization

    Hmm, after close examination of your code you're right they are very similar. The only difference is that you use De Polignac's Formula which is faster, but you failed to properly handle the...
  3. Replies
    5
    Views
    2,246

    Re: Factorial calculation optimization

    Hmm, interesting problem...

    So you want to find the last 5 digits of n! after all the trailing zeros?

    The first thing to do is eliminate all the trailing zero.
    Each trailing zero equates to a...
Results 1 to 3 of 3