How to cast from Double to Int? : <p>Suppose I have a <code>Double</code> and I create an <code>Int</code> from the <code>Double</code>:</p>

<pre><code>var a : Double = 4.0
var b = Int(a)
</code></pre>

<p>In the past, the above code could result in <code>b=3</code> if <code>a</code> was internally represented as <code>3.999999999999999</code>. Do we not have to worry about this anymore in Swift? What is the correct way to cast a Double to an Int?</p>
