Implementing the Spigot algorithm for π (pi)

后端 未结 3 1433
终归单人心
终归单人心 2021-02-06 02:16

I\'m having a hard time understanding the Spigot algorithm for π (pi) found here at the bottom of the page.

I\'m getting lost at the bottom of part 2 \"Put A

3条回答
  •  一个人的身影
    2021-02-06 02:40

    I am seeing a difference in the o/p digits of the above spigot pi program when compared with http://www.numberworld.org/misc_runs/pi-10t/details.html

    Correct Value of 50 digits of Pi : http://www.numberworld.org/misc_runs/pi-10t/details.html

    3.

    1415926535 8979323846 2643383279 5028841971 6939937510

    Above spigot pi :

    3.

    1415926535 8979323846 2643383279 5**(0)**28841971 6939937510

                                         ^^^ zero missing
    

    Changed the 4 digits per loop to 8 digits by modifying long f = 100000000;

    produced the correct result.

提交回复
热议问题