What is the fastest way to get the value of π?

I’m looking for the fastest way to obtain the value of π, as a personal challenge. More specifically, I’m using ways that don’t involve using #define constants like M_PI, or hard-coding the number in. The program below tests the various ways I know of. The inline assembly version is, in theory, the fastest option, though … Read more

How do I determine whether my calculation of pi is accurate?

I was trying various methods to implement a program that gives the digits of pi sequentially. I tried the Taylor series method, but it proved to converge extremely slowly (when I compared my result with the online values after some time). Anyway, I am trying better algorithms. So, while writing the program I got stuck … Read more