Created
July 19, 2019 02:46
-
-
Save CMCDragonkai/fdef55531c661359f67b0d9b696f59b9 to your computer and use it in GitHub Desktop.
Random Ranges in JS #javascript
This file contains 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
// by scaling the uniform distribution between [0,1) to [min,max) | |
function randomRangeInt (min, max) { | |
return min + Math.floor(Math.random() * (max - min)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment