title: python loop OverflowError: (34, 'Result too large')
body: <p>python 2.5 on osx</p>
  
  <p>I got the OverflowError: (34, 'Result too large') for the following code:</p>
  
  <pre><code>x = 1.04
  for i in range(2, 101):
    x += x**i
  print x 
  </code></pre>
  
  <p>So instead, I used the code below; no error was generated.</p>
  
  <pre><code>x = 0
  for i in range(1, 101):
    x += 1.04**i
  print x
  </code></pre>
  
  <p>The result is 1287.12865279 and this seems miles away from the maximum float. If I need to use a different type to handle this floating point calculation, why does the latter code work while the former one doesn't? I'm puzzled..... Any help&explanation on resolving the error would be much appreciated.</p>