Created
March 20, 2018 16:23
-
-
Save dvv/764385041f09c625e01671cbdb798f17 to your computer and use it in GitHub Desktop.
c random uint32_t generator
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
uint32_t _rand(void) | |
{ | |
static uint32_t Z; | |
if (Z & 1) { | |
Z = (Z >> 1); | |
} else { | |
Z = (Z >> 1) ^ 0x7FFFF159; | |
} | |
return Z; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment