Darshan Kanade added the comment:
Thanks Mark, for the explanation. I had no idea about how the floating point
values are represented as binary fractions in the computer hardware. It was a
very informative document. Thanks again!
--
nosy: -serhiy.storchaka
Darshan Kanade added the comment:
The issue is that pi = k*math.cos(math.radians((90 - 180/k))) is giving wrong
answer(289.384326...) for larger values of k, say k=2**62, but for smaller
values say, k=100 it is giving correct answer(3.14)
pi = k*math.sin(math.radians(180/k)) on the
Change by Darshan Kanade :
--
resolution: not a bug ->
___
Python tracker
<https://bugs.python.org/issue46444>
___
___
Python-bugs-list mailing list
Un
Change by Darshan Kanade :
--
status: closed -> open
___
Python tracker
<https://bugs.python.org/issue46444>
___
___
Python-bugs-list mailing list
Unsubscrib
Darshan Kanade added the comment:
In the program, I did convert degrees to radians
So, this was what I used-
1)pi = k*math.cos(math.radians((90 - 180/k)))
2)pi = k*math.sin(math.radians(180/k))
where k=2**62
--
___
Python tracker
<ht
New submission from Darshan Kanade :
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