Jun-28-2019, 11:34 PM
(This post was last modified: Jun-28-2019, 11:34 PM by Gribouillis.)
Skaperen Wrote:those are less accurate approximations for Pi than the ratio i showed, which give the full precision that C double on x86 can represent, which is the type that Python uses.
If you want a better approximation of pi than the double precision constant
math.pi
, you can use a multiprecision library such as gmpy2 and/or a known numerical algorithm converging to pi. Many of the existing algorithms give rational approximations which could be passed to Fraction.limit_denominator()
. You can also find easily millions of digits of pi directly on the web. A simple search points to a file suposedly from the MIT with 1 billion digits.