diff options
author | GriffinR <griffin.g.richards@gmail.com> | 2020-02-14 16:12:35 -0500 |
---|---|---|
committer | huderlem <huderlem@gmail.com> | 2020-02-25 12:54:08 -0600 |
commit | faf0ba8662ecd54b4160920097074aad3c2dc8cb (patch) | |
tree | c494ba3ef5757776bdcf7f66698d764c8f5ac43a /include/random.h | |
parent | 6eb44dc50714f184cea4453704636370263e7efc (diff) |
Use macro for randomization with ISO value
Diffstat (limited to 'include/random.h')
-rw-r--r-- | include/random.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/random.h b/include/random.h index 85ff71abf..6bf61de6c 100644 --- a/include/random.h +++ b/include/random.h @@ -10,6 +10,9 @@ u16 Random2(void); //Returns a 32-bit pseudorandom number #define Random32() (Random() | (Random() << 16)) + +// The number 1103515245 comes from the example implementation of rand and srand +// in the ISO C standard. #define ISO_RANDOMIZE1(val)(1103515245 * (val) + 24691) #define ISO_RANDOMIZE2(val)(1103515245 * (val) + 12345) |