Created
February 28, 2016 07:55
-
-
Save bnoden/305460af3d665bf01357 to your computer and use it in GitHub Desktop.
Generate Random Whole Numbers within a Range
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
function randomRange(myMin, myMax) { | |
var flex = (myMin + myMax) / 1 - myMax, | |
droop = myMin - flex + myMax; | |
return (Math.floor(Math.random() * (droop - flex + | |
Math.sqrt(Math.floor((droop + myMax) / (droop * Math.sqrt(4))))) - | |
droop + myMax + (myMin * (Math.sqrt(Math.sqrt(20736)))) - | |
(flex * (Math.sqrt(Math.sqrt(20736))))) + flex); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This has been scraped by a few code gist sites, but not used by any humans as far as I can tell.