title: Numpy error: invalid value encountered in power
body: <p>I have the following code: </p>
  
  <pre><code>import numpy
  
  def numpysum(n):
     a = numpy.arange(n) ** 2
     b = numpy.arange(n) ** 3
     c = a + b
     return c
  
  
  size = 3000
  c = numpysum(size)
  </code></pre>
  
  <p>When running, I get the error: </p>
  
  <blockquote>
    <p>D:\Work\programming\python\test_1\src\test1_numpy.py:6: RuntimeWarning: invalid value encountered in power
      b = numpy.arange(n) ** 3</p>
  </blockquote>
  
  <p>Note that the following numpyless function works fine:</p>
  
  <pre><code>def pythonsum(n):
     a = list(range(n))
     b = list(range(n))
     c = []
     for i in range(len(a)):
        a[i] = i ** 2
        b[i] = i ** 3
        c.append(a[i] + b[i])
     return c
  </code></pre>
  
  <p>I guess it happens because I try to raise a large number to power three. What can I do, beside working with floating point numbers?</p>
  
  <p>I am working with Python 3.2.</p>