Is there a proper way to convert a Double to a Float in Swift?
<p>I'm trying to convert a double being retrieved from an iPhone sensor into a float. Unfortunately, I can't seem to find any resources on built in functionality to do so.</p>

<p>If I initialize a Float or a cast to a Float from a double like so:</p>

<pre><code>let roll  = (Float)(attitude!.roll)
let pitch  = (Float)(attitude!.pitch)
</code></pre>

<p>Or</p>

<pre><code>let roll = Float(attitude!.roll)
let pitch = Float(attitude!.pitch)
</code></pre>

<p>the original Double values still don't get converted properly.
For instance, <code>9.436222</code> and <code>27.895268</code> become <code>0.486864</code> and <code>0.164693</code> respectively. Is there a proper way to cast to a Float from a Double that preserves the larger decimal value?</p>