![]() Let's now begin our code: import math as mp Our good old math library cannot do that as it mostly returns IEEE-$754$ $64$-bit result, which is roughly $17 $ digits only. There are many libraries which can help us in this. For this we will be using a special python library. To reduce this error, we have to increase the precision of our calculation. Normally, when we perform this sort of algorithm, mostly the error comes from the fractional part. We are doing so, to show you guys how powerful this method is. In some later blog, we will see how to make this much more efficient. So, how are we going to write the code?, well for this blog, we are directly going to use above expression. Just the first term is this much accurate. Let's just take the first term of this series and see what it gives us. Let's see the formula and how we are going to use that. ![]() This is based on Ramanujan's $\pi $ formula and was discovered in $1988$. Using this in 14 th August, 2021 $62.8$ trillion digits of $\pi $ was calculated. ![]() We will be using Chudnovsky Algorithm, which is one of the fastest method to calculate the value of $\pi $. ![]() Today we will see a python code to find the value of $\pi $ up to $1,00,000$ within $3$ to $4$ second. $\pi$ is a journey an experience unless you try to see the natural poetry that exists in $\pi$, you will find it very difficult to learn. $\pi$ is not just a collection of random digits. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |