Python Forum
method float.as_integer_ratio() always ...
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
method float.as_integer_ratio() always ...
#4
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.
Reply


Messages In This Thread
RE: method float.as_integer_ratio() always ... - by Gribouillis - Jun-28-2019, 11:34 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020