First I must say that I'm new to C programming, a second sorry on my bad english!
My problem is that I try to print more then 1 milion didgits of PI. I'm using Gauss-Legendre algorithm that is used in program Super_pi. I was using Google for some time now, and only that I could find is that I need to use some non standard library! Any help is useful! Code is attached.
Code:#include <stdio.h> #include <math.h> int main(){ int i; float a = 1; float b = a/sqrt(2); float t = a/4; float x = a; float y; float p; for (i = 1; i <= 19; i++) { y = a; a = (a+b)/2; b = sqrt(b*y); t = t-x*(a-y)*(a-y); x = 2*x; } p = (a+b)*(a+b)/(4*t); printf("%.1000000f",p); getch(); return 0; }