Message411005
I was solving this problem to find the approximate value of pi using the Archimedes method using two different logics -
1) The first one used the formula pi = k*cos(90-180/k) but when I gave very large input, say k=2**62 sides of polygon, then it gives the value of pi as 282.3843260569851... for comparatively smaller k=1000000 it is around 3.14
2)Because the first one was giving wrong answer for larger values, I googled for solution and came across this other logic using the formula pi = k * sin(180/k).
In this method, we get values of pi around 3.14 no matter how large the input is, even if it is k=2**62! |
|
Date |
User |
Action |
Args |
2022-01-20 06:25:26 | darshan.kanade | set | recipients:
+ darshan.kanade |
2022-01-20 06:25:26 | darshan.kanade | set | messageid: <1642659926.26.0.654895393919.issue46444@roundup.psfhosted.org> |
2022-01-20 06:25:26 | darshan.kanade | link | issue46444 messages |
2022-01-20 06:25:26 | darshan.kanade | create | |
|