title: Random number between two decimals in Swift
body: <p>I'd like to get a random number between two small decimal numbers.</p>
  
  <p>Between maybe 0.8 and 1.3.</p>
  
  <pre><code>var duration = CGFloat(arc4random() % 0.8) / 1.3
  </code></pre>
  
  <p>or </p>
  
  <pre><code>var duration = CGFloat(arc4random() % 0.5) + 0.8
  </code></pre>
  
  <p>Thanks!</p>