Computer Science Canada Finding the value of pi=3.141592653589793238... |
Author: | AtoZ [ Sat Jan 31, 2009 5:51 pm ] | ||
Post subject: | Finding the value of pi=3.141592653589793238... | ||
This program find the value of pi to some number of digits using the method to find an accurate value. Unfortunately, household computers are not very powerful and neither is the turing environment, therefore, it only calculates to 6 digits quickly. For my computer, with a speed of around 1.3mil loops/sec, it takes 25 seconds to get 7 digits, but only 3 seconds to get 6 digits. Also, it calculates pi to 49 digits (which is the max in turing i think), but the correct digits are only limited to maybe 5-7. If you have time or a very fast and powerful computer, run it for maybe 8-10 digits, and let me know if it works properly. This program also finds your computer speed and your processor number and operating system. If you post about the run time of the program, plz also post ur computer speed with it. Oh btw, i copied the method to find the computer speed from a turing submission by Zren from this link:http://compsci.ca/v3/viewtopic.php?t=19986. So, sorry for copying, but it is not a major part of the program.
MOD EDIT: Remember the code tags! |
Author: | Ultrahex [ Sat Jan 31, 2009 11:08 pm ] | ||||||||
Post subject: | Re: Finding the value of pi=3.141592653589793238... | ||||||||
Using your code:
Using my modification of your code (same algorithm): (slower due to printing of statements, cause of other processes plus allocation of memory)
1.4GHZ amd thunderbird emulated using wine on linux similar program written in C
Or if you want even better (14 digits, 0.179 seconds):
|
Author: | The_Bean [ Sun Feb 01, 2009 9:26 am ] | ||
Post subject: | Re: Finding the value of pi=3.141592653589793238... | ||
I would have to say memorizing the number of digits you want is a lot faster. Sure it might take 2 months for 155 decimal places, but then it only takes roughly 30 seconds to type it in. You can also use random sections from it for passwords.
|
Author: | michaelp [ Sun Feb 01, 2009 10:27 am ] |
Post subject: | RE:Finding the value of pi=3.141592653589793238... |
http://www.gamedev.net/community/forums/topic.asp?topic_id=418236 |