title: Calculating large fractions in Python?
body: <p>I am trying to calculate fractions in Python 2.7.  The <code>limit_denominator</code> method works great for the first 15 iterations of this code.  However, then the code gets stuck in a loop, outputting denominators less than 1,000,000</p>
  
  <pre><code>Fraction = 1217471/860882
  </code></pre>
  
  <p>When I don't use <code>limit_denominator</code>, I get repeat outputs like this:</p>
  
  <pre><code>Fraction = 141421356237/100000000000
  </code></pre>
  
  <p>Eventually I want to iterate <code>i</code> to 1000, so my fractions will be very large. Any help?</p>
  
  <pre><code>from fractions import *
  i = 0
  x = 1/2.0
  x1 = 0
  count = 0
  while i &lt; 20:
      (y) = (1.0 + (x))
      (x) = (1 / (2.0 + (x)))
      y1 = Fraction(str(y)).limit_denominator()
      print("\nFraction = " + str(y1))
      i += 1
  </code></pre>