Created
November 14, 2014 10:07
-
-
Save ravenberg/0eafa910b58fd6807cfe to your computer and use it in GitHub Desktop.
Java math: Generate a random positive or negative integer in a given range.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| int randomInteger = -10 + (int) (Math.random() * ((10 - (-10)) + 1)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment