title: "Unpack requires a string argument of length 4" when unpacking floats?
body: <p>I am trying to convert hex value to float using (Python 2.7) the following method:</p>
  
  <pre><code>def hex2float(x):
      y = 0
      z = x.decode('hex') 
      try:
          y = struct.unpack('!f', z)[0]
      except:
          print sys.exc_info()[1]    
      print 'z = ' + z 
      print 'y = %s' % (y) 
      print 'x = ' + x
      return
  
  def foo28():
      x = '615885'   #8.9398e-039
      hex2float(x)
  </code></pre>
  
  <p>The output is as follows:</p>
  
  <pre><code>unpack requires a string argument of length 4
  z = aXà
  y = 0
  x = 615885
  </code></pre>
  
  <p>I notice that I get the exception message for really small values. Is there a proper way to convert hex values to floating values for such cases.</p>