title: How to generate a Random Floating point Number in range, Swift
body: <p>I'm fairly new to Swift, only having used Python and Pascal before. I was wondering if anyone could help with generating a floating point number in range. I know that cannot be done straight up. So this is what I've created. However, it doesn't seem to work.</p>
  
  <pre><code>func location() {
      // let DivisionConstant = UInt32(1000)
  
      let randomIntHeight = arc4random_uniform(1000000) + 12340000
      let randomIntWidth = arc4random_uniform(1000000) + 7500000
  
      XRandomFloat = Float(randomIntHeight / UInt32(10000))
      YRandomFloat = Float(randomIntWidth / UInt32(10000))
  
      randomXFloat = CGFloat(XRandomFloat)
      randomYFloat = CGFloat(YRandomFloat)
  
      self.Item.center = CGPointMake(randomXFloat, randomYFloat)
  }
  </code></pre>
  
  <p>By the looks of it, when I run it, it is not dividing by the value of the <code>DivisionConstant</code>, so I commented this and replaced it with a raw value. However, <code>self.Item</code> still appears off screen. Any advice would be greatly appreciated.</p>