Skip to content

Instantly share code, notes, and snippets.

@ejknapp
Last active December 13, 2015 18:38
Show Gist options
  • Save ejknapp/4956877 to your computer and use it in GitHub Desktop.
Save ejknapp/4956877 to your computer and use it in GitHub Desktop.
Random number between two numbers.
- (int)randomNumberFrom:(int)first to:(int)second
{
int difference = second - first;
int randomValue = arc4random() % (difference + 1);
return randomValue + first;
}
@ejknapp
Copy link
Author

ejknapp commented Nov 2, 2013

You are correct sir and the code has been corrected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment