title: How to convert 4 bytes to a Swift float?
body: <p>I'm writing a MsgPack parser in Swift as a way to learn the language. It doesn't feel very well suited to the task but I've been making progress. Now I've hit a block where I can't seem to convince it to convert 4 bytes into a float.</p>
  
  <pre><code>var bytes:Array&lt;UInt8&gt; = [0x9A, 0x99, 0x99, 0x41] //19.20000
  
  var f:Float = 0
  
  memccpy(&amp;f, &amp;bytes, 4, 4)
  
  print(f)
  </code></pre>
  
  <p>In the playground I get:</p>
  
  <blockquote>
    <p>fatal error: Can't unwrap Optional.None
    Playground execution failed: error: Execution was interrupted, reason: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0).</p>
  </blockquote>
  
  <p>Any ideas what to try next?</p>