The higher the length of your serie , the higher precision you have . You must think that pi comes from a circle . The serie tells you that it can approximate by saying that a circle is a polygon having a lot of edges , so more edges more accurate will be your PI estimation . Enter 100 , then 300 , then 1000 , then 4000 . Of course the recursion has a limitation to the max stack frames so if you enter 10000 you will have a stack frame overflow.