title: RuntimeWarning: invalid value encountered in power
body: <p>This is part of the code I am working on. Look at the last line.</p>
  
  <pre><code>def xyz2srgb(xyz):
      """Convert from XYZ colorspace to sRGB"""
      xyz = xyz.T
      srgb = N.zeros_like(xyz)
      srgb[0] = 3.241*xyz[0] - 1.5374*xyz[1] - 0.4986*xyz[2]
      srgb[1] = -0.9692*xyz[0] + 1.876*xyz[1] + 0.0416*xyz[2]
      srgb[2] = 0.0556*xyz[0] - 0.204*xyz[1] + 1.057*xyz[2]
  
      srgb /= float(srgb.max())
  
      a = 0.055
      srgb = N.where(srgb &lt;= 0.0031308,
                  12.92*srgb,
                  (1+a)*srgb**(1/2.4)-a)
  </code></pre>
  
  <p>It throws an error:</p>
  
  <pre><code> ./example.py:29: RuntimeWarning: invalid value encountered in power
    (1+a)*srgb**(1/2.4)-a)
  </code></pre>
  
  <p>Is this some range limit? I found a similar thread on SO: <a href="https://stackoverflow.com/questions/9140744/numpy-error-invalid-value-encountered-in-power">Numpy error: invalid value encountered in power</a></p>
  
  <p>Any clue? Thanks.</p>