title: Random float between two numbers?
body: <p>I currently have a method to attempt to get a random float between two numbers that I provide however, it does not work properly. </p>
  
  <p>For example if I feed in 4.0 as the lower float and 4.5 as the higher float, I get results that are like 0.8 or 1.2 and sometimes it is between those two numbers. So this leads me to believe that this method is no good. Here is the method:</p>
  
  <pre><code>- (float)randomFloatBetween:(float)num1 andLargerFloat:(float)num2 {
      return ((float)arc4random() / ARC4RANDOM_MAX) * num2-num1 + num1;
  }
  </code></pre>
  
  <p>This is ARC4RANDOM_MAX</p>
  
  <pre><code>#define ARC4RANDOM_MAX 0x100000000
  </code></pre>
  
  <p>Anyway, what is causing this and how can I fix this?</p>
  
  <p>Thanks!</p>