Binary operator '%' cannot be applied to operands of type 'UInt32' and 'UInt' : <p>I am new to programming in Swift and I am trying to develop a simple game in the hopes that it will increase my exposure to the language syntax and logic. Currently I have a problem in Swift which is stating "Binary operator '%' cannot be applied to operands of type 'UInt32' and 'UInt'" and I do not know how to approach this problem as I am a newbie to the language. Can someone show me how to approach this problem and why is the problem being caused in the first place? </p>

<p>For reference purposes I have included a method that causes the problem and the problem name.</p>

<pre><code>   func randomFloatBetween(_ smallNumber: CGFloat, and bigNumber: CGFloat) -&gt; CGFloat {
        let diff: CGFloat = bigNumber - smallNumber
        return ((CGFloat(arc4random() % (UInt(RAND_MAX) + 1)) / RAND_MAX) * diff) + smallNumber
    }
</code></pre>
