diff options
author | YamaArashi <shadow962@live.com> | 2016-10-22 23:46:58 -0700 |
---|---|---|
committer | YamaArashi <shadow962@live.com> | 2016-10-22 23:46:58 -0700 |
commit | 6bde99d93b06dcd7b8480ec14f3103707d8835e2 (patch) | |
tree | 5423bd9c5bd79f5c5b6ec10485fbef098fffc9bb /src | |
parent | ff71f9b220f7aec6faf059a129649868e7a43d5e (diff) |
add note about RNG multiplier value
Diffstat (limited to 'src')
-rw-r--r-- | src/rng.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -1,11 +1,14 @@ #include "global.h" #include "rng.h" +// The number 1103515245 comes from the example implementation of rand and srand +// in the ISO C standard. + u32 gRngValue; u16 Random(void) { - gRngValue = 0x41c64e6d * gRngValue + 0x00006073; + gRngValue = 1103515245 * gRngValue + 24691; return gRngValue >> 16; } |