Hi again texcodec, i used this and I get correct values, no need to change the base.
3,13333333333333
0,00808913308913309
0,000164923924115101
5,06722085385879E-06
1,8789290093772E-07
7,76775121517736E-09
3,44793293050862E-10
1,6091877155537E-11
7,79570295400102E-13
3,88711525990975E-14
Press any key to continue...
or better pi += to get the agregate value of every calculation.
3,13333333333333
3,14142246642247
3,14158739034658
3,14159245756744
3,14159264546034
3,14159265322809
3,14159265357288
3,14159265358897
3,14159265358975
3,14159265358979
3,14159265358979
3,14159265358979
3,14159265358979
3,14159265358979
3,14159265358979
3,14159265358979
Math.PI ->3,14159265358979
Press any key to continue...
I see 2 thing about this method:
1-. k is no equal to nth digit of pi, I mean with k=1 you get 3 correct decimal of pi, with k=2 -> 4, with k=3 -> 6, k=4 -> 7, so if you ask for a number of digit this is not directly the number of for to execute.
2-.With k>9 the double value is not enough to show such precission, so you'll get as better as Math.PI.
The class I linked you in the other post give pi as a string, and I thing that in every bucle you get a new digit, appending it to existing pi string, so the number of bucle (
k) gives you the nth digit.
So seeing your code you got the formula working correctly, congratulations.
Regards