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 constan
Back in the old days, with small word sizes and slow or non-existent floating-point operations, we used to do stuff like this:
/* Return approximation of n * PI; n is integer */
#define pi_times(n) (((n) * 22) / 7)
For applications that don't require a lot of precision (video games, for example), this is very fast and is accurate enough.