INSANE Pi VALUE CALCULATION!!!!!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • daniel aristidou
    Contributor
    • Aug 2007
    • 494

    INSANE Pi VALUE CALCULATION!!!!!

    Hi guys....i want to create a program to calculate pi. on a computer...i was gonna chuck in the bin.
    Then i thought....why not calculate pi on it for a couple of years?

    So now i want to calculate pie!!

    Thing is Redundancy is an issue. the values must be stored to harddrive as it is calculated and not to RAM. becuase the value can become very large

    i will be using this formula for pi :

    pi/4 = 1 -1/3 + 1/5 - 1/7 + 1/9 - 1/11 + 1/13 - 1/15 .....etc
    (hope you can see the pattern)

    I think i can use a loop since the value gets smaller the further you go on...only the last part of the number is required each time...So the rest of the digits can be stored to ROM.

    so lets Start coding!!!!
    But first (because im not an excelent mathematician ...."YET")
    If pi/4 = 1 -1/3 + 1/5 - 1/7 + 1/9 - 1/11 + 1/13 - 1/15 can i do

    pi = (4) - 4(1/3) + 4(1/5) - 4(1/7) etc?
  • Dököll
    Recognized Expert Top Contributor
    • Nov 2006
    • 2379

    #2
    Originally posted by daniel aristidou
    But first (because im not an excelent mathematician ...."YET")
    If pi/4 = 1 -1/3 + 1/5 - 1/7 + 1/9 - 1/11 + 1/13 - 1/15 can i do

    pi = (4) - 4(1/3) + 4(1/5) - 4(1/7) etc?
    Hang in there bud...

    Cannot find a way to do this, just letting you to stay tuned, some smart ones may be passing through;-)

    Sorry for your troubles!

    Dököll

    Comment

    • daniel aristidou
      Contributor
      • Aug 2007
      • 494

      #3
      Hey.....
      Forget about that.....now... it doesnt matter.
      What does matter is that i cant get it to calculate more than 30 decimal places.

      Does any one have code on how to make extremely large calculations accurate too a couple of thousand decimal places?

      Either that...or i think im gonna have to use an array: to hold each decimal place in each row... so that i can create a realy large accurate number.

      Comment

      • daniel aristidou
        Contributor
        • Aug 2007
        • 494

        #4
        Ok...i now know that im definetly gonna need an array.
        which holds only one number " 1 - 9 " In each row.

        The problem is how to implement it.
        How to have calculations that carry the remainer to the next row etc.
        Any ideas anyone?

        Comment

        • jamesd0142
          Contributor
          • Sep 2007
          • 471

          #5
          Im interested in how you would continue where you left off if for example there was a power cut?

          You say you intend to save each value to the hard disk reather than ram, i suppose you will need to store the latest calculation also?

          so you can restart from where it left off?

          Im not clear but im sure you will get my drift...?

          James

          Comment

          • daniel aristidou
            Contributor
            • Aug 2007
            • 494

            #6
            Originally posted by jamesd0142
            Im interested in how you would continue where you left off if for example there was a power cut?

            You say you intend to save each value to the hard disk reather than ram, i suppose you will need to store the latest calculation also?

            so you can restart from where it left off?

            Im not clear but im sure you will get my drift...?

            James
            James..that is exactly what i intend to do.
            Though i will save around every 10 minutes or so as not to create too much lag.
            I will save the n value reached and the current value of pi.
            What i was trying to say before is that when you get to (just theoretical example) 1/10000000 the first 10 digits are correct and no longer need to be saved in ram because they are no longer part of the calculation.bec ause 1/10000000 has a value so small it does not effect the uper regions of pi
            I think this is the only advantage of using this calculation technique : thats why im using it

            hehe.
            ps.using this formula to calculate pi.
            will probably take a week in order to accurately calculate the first 10,000 decimals.

            Comment

            Working...