This mysterious 3.1415926...,
This we all remember, at least the first seven decimal places 😅

 π  = 3.1415926535897932384626433832795028841971693993751...
The ratio of the circumference of a circle to its diameter.

Circle-pi

 pi=C/d=C/(2r)   1)

One of Archimedes many significant contributions to mathematics was his approximation of the value of π
He was the first mathematician to establish a theoretical calculation for π instead of an estimation.
By inscribing and circumscribing polygons on a circle, he was able to constrain the value of π between 3+10/71 and 3+1/7.

 
This mysterious π 3.141592..., which comes in at every door and window, and down every chimney.
Augustus De Morgan (1806-1871)

The following tiny C code computes digits of π   (Boris Gourevitch)
                    main() {
                        int a=10000,b,c=8400,d,e,f[8401],g;
                        for(;b-c;)f[b++]=a/5;
                        for(;d=0,g=c*2;c-=14,printf("%.4d",e+d/a),e=d%a)
                            for(b=c;d+=f[b]*a,f[b]=d%--g,d/=g--,--b;d*=b);
                    }
                    
1) Wolfram Mathworld

C -code to calculate the value of π


Tested on Ubuntu 20.04 Linux Kernel 5.4.0-104-generic (16.3.2022)
  Requires libgmp3-dev library
  Ubuntu: apt install libgmp3-dev



Powered By   Kotisivut.com - Luotettava webhotelli    CodeIgniter PHP Framework   BaseURL: http://datatuki.net/web/  Page rendered in 0.7549 seconds