Pi

Status
Not open for further replies.

m3trj

Fully Optimized
Messages
1,574
Don't know where this post belongs, but according to my calculations, the billionth (1,000,000,000) digit after the decimal point in pi (AKA 3.142) is...9!

Sheesh that took several hours of CPU time...
 
if you run a unix based system you can use bc, set the decimal range and then calculate arc tangent of 1 and multiply it by 4:

bc -l
scale=1000
4*a(1)=

3.141592653589793238462643383279502884197169399375105820974944592307\
81640628620899862803482534211706798214808651328230664709384460955058\
22317253594081284811174502841027019385211055596446229489549303819644\
28810975665933446128475648233786783165271201909145648566923460348610\
45432664821339360726024914127372458700660631558817488152092096282925\
40917153643678925903600113305305488204665213841469519415116094330572\
70365759591953092186117381932611793105118548074462379962749567351885\
75272489122793818301194912983367336244065664308602139494639522473719\
07021798609437027705392171762931767523846748184676694051320005681271\
45263560827785771342757789609173637178721468440901224953430146549585\
37105079227968925892354201995611212902196086403441815981362977477130\
99605187072113499999983729780499510597317328160963185950244594553469\
08302642522308253344685035261931188171010003137838752886587533208381\
42061717766914730359825349042875546873115956286388235378759375195778\
18577805321712268066130019278766111959092164201988
 
I used a small Windows based program. It took about 11 hours though.

I tried prime95, but it only goes to 32 million digits I think.

There are various algorithms you can use, so I might try and confirm that number using a different one when I have some spare time.
 
Yeah I think it's called PiFast.

There's a few others I tried too, pi_css5, qpi29, simplepi, etc. PiFast was the best. Not all of the programs I tried allowed me to calculate 1 billion digits though. After all, it is a big number!

If you're gonna try to calculate it it's probably best to have a lot of memory. I've never seen my page file so big.

I'm gonna try to write my own pi calculator.

Oh yeah, the output file was a 1.3GB .txt file, and I couldn't open it in one piece so I also used something else to split the file into a couple of hundred smaller pieces. That was called "jsplit" or something.
 
Status
Not open for further replies.
Back
Top Bottom