Skip to content

Instantly share code, notes, and snippets.

@Nub
Created November 14, 2011 02:55
Show Gist options
  • Select an option

  • Save Nub/1363129 to your computer and use it in GitHub Desktop.

Select an option

Save Nub/1363129 to your computer and use it in GitHub Desktop.
- (float)randomFloatBetween:(float)smallNumber and:(float)bigNumber {
float diff = bigNumber - smallNumber;
return (((float) (arc4random() % ((unsigned) 0x100000000 + 1)) / 0x100000000) * diff) + smallNumber;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment