- Taken from here.
- Bitwise
OR
with0
floors the number it's paired with.- Performance is similar to
Math.floor()
.
- Performance is similar to
- The post highlights it's higher performance to pre-generate random numbers and then loop through them.
Last active
August 29, 2015 14:00
-
-
Save naganowl/aef87333e2a7dbfee42d to your computer and use it in GitHub Desktop.
Simple line to generate random integers
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
Math.random()*101|0; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment