It can only show till 15th digit precison. The acos() function returns the values in the range of that is an angle in radian. Sample Output Vaule of Pi is : 3.141592653589793Īcos() is an inbuilt function in C++ STL and is also present python language and it’s the same as the inverse of cosine in maths. Print("Vaule of Pi is : ",ramanujan_pi()) #Stop loop when it reaches 15th digit precision (femto) #initialise sum=0, n=0, and a variable i to store 2√2/(99)^2 Though the Time Complexity is higher than previous approaches, in this approach, one will need significantly less number of iterations so this is considered to be an effective technique.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |