Created
December 23, 2015 07:28
-
-
Save andrewharmellaw/4a42eb6ac1f2db9d502b to your computer and use it in GitHub Desktop.
The function to alias - nextInt
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
def nextInt: (Int, RNG) = { | |
val newSeed = (seed * 0x5DEECE66DL + 0xBL) & 0xFFFFFFFFFFFFL | |
val nextRNG = SimpleRNG(newSeed) | |
val n = (newSeed >>> 16).toInt | |
(n, nextRNG) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment