How can I program a code to aproximate to the number pi? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4

How can I program a code to aproximate to the number pi?

30th Mar 2018, 2:00 AM
Andrés Jaramillo
Andrés Jaramillo - avatar
4 Answers
0
In my example code I have shown how Madhava's algorithm is extremely precise and performing. For example, with 20 computation cycles, the Leibniz (Euler) algorithm can not achieve a single byte precision, while Madhava can even reach a depth of 10 bytes! Please see my code and comment if you wish.. https://code.sololearn.com/cDFUjarCHTlc/#py
1st Apr 2018, 9:28 PM
Michael Isac Girardi
Michael Isac Girardi - avatar
+ 7
This gives a few different formulas for pi. http://www.mathscareers.org.uk/article/calculating-pi/
30th Mar 2018, 2:19 AM
John Wells
John Wells - avatar
+ 4
This one makes some crazy fast pi: https://code.sololearn.com/c1UGxtX0G8h2/?ref=app This one just feels crazy, using large random coprimes (+ youtube companion video): https://code.sololearn.com/c6WmHJ82s1Y2/?ref=app
30th Mar 2018, 5:13 AM
Kirk Schafer
Kirk Schafer - avatar
30th Mar 2018, 5:09 AM
Sebastian Keßler
Sebastian Keßler - avatar