about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/prng/__rand48_step.c2
-rw-r--r--src/prng/rand_r.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/prng/__rand48_step.c b/src/prng/__rand48_step.c
index 755b4f2f..105f810f 100644
--- a/src/prng/__rand48_step.c
+++ b/src/prng/__rand48_step.c
@@ -1,5 +1,5 @@
 #include <stdlib.h>
-#include <inttypes.h>
+#include <stdint.h>
 
 uint64_t __rand48_step(unsigned short *xi, unsigned short *lc)
 {
diff --git a/src/prng/rand_r.c b/src/prng/rand_r.c
index e96cfba9..ef26dbde 100644
--- a/src/prng/rand_r.c
+++ b/src/prng/rand_r.c
@@ -2,5 +2,5 @@
 
 int rand_r(unsigned *seed)
 {
-	return (*seed = *seed * 1103515245 + 12345) & 0x7fffffff;
+	return (*seed = *seed * 1103515245 + 12345)/2;
 }