Click here to Skip to main content
15,892,537 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello everyone,

I am wondering if there is any way of calculating PI as far as possible?

Today on school I heard that PI has a million numbers after the 3.14.
So, I thought why not try and calculate all those numbers?

I was planning on using a void that will use itself inside it,
a little bit like so:

C#
public void CalculatePI(int Start)
{
 int Write = Start + (Calculate PI here).
 Console.WriteLine(Write.ToString());
 CalculatePI(Write);
}


Does anyone know where to start?
Posted
Comments
Richard C Bishop 28-Mar-13 16:54pm    
Pi is infinite in its decimal representation. You will never write Pi to the end.
Yvar Birx 28-Mar-13 16:54pm    
Yes, I understand, that's why I am interested into calculating it as far as possible. I have no clue where to start though.
Richard C Bishop 28-Mar-13 16:56pm    
I see, you want to get as mush as possible. Well, that could be tricky and I do not know where to start either.
Yvar Birx 28-Mar-13 16:56pm    
Yes, exactly, yeah it is, I'm not sure too. :P
Sergey Alexandrovich Kryukov 28-Mar-13 17:18pm    
I cannot believe that someone can think that π can have finite number of digits? Or it was a joke? :-)
—SA

1 solution

You are wrong. PI has infinite number of "numbers after 3.14". Do you have that much memory... or time? I doubt.
Please read this article: http://en.wikipedia.org/wiki/Approximations_of_%CF%80[^], before you try to calculate all those numbers. Be aware that highly qualified mathematicians and high performance computers are working on beating the current record[^].
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 28-Mar-13 17:19pm    
5ed :-)
I just would like to note that it does not look like an interesting exercise for "qualified mathematicians".
Years ago, I heard that for the numbers πe and eπ, one was proven to be a transcendental number, but it wasn't proven for another one (I don't remember which is the two). This is more interesting. As to the calculations, I don't think any considerable mathematical background needs to be involved... :-)
—SA
Zoltán Zörgő 28-Mar-13 17:29pm    
Thanks.
You'r right, but compare the level of the question with the level of the knowledge needed. I was using this expression more as an illustration. But still: the algorithms are not complicated but not so easy to implement in an efficient way.
Sergey Alexandrovich Kryukov 28-Mar-13 17:31pm    
Oh, yes... :-)
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900