aboutsummaryrefslogtreecommitdiff
path: root/PenroseRand.c
diff options
context:
space:
mode:
Diffstat (limited to 'PenroseRand.c')
-rw-r--r--PenroseRand.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/PenroseRand.c b/PenroseRand.c
new file mode 100644
index 0000000..98f396e
--- /dev/null
+++ b/PenroseRand.c
@@ -0,0 +1,13 @@
+#include "PenroseRand.h"
+
+float rrand(int *seed)
+{
+ int i = ((*seed = *seed * 1103515245 + 12345)>>16) & 077777;
+ return((float)i/16384. - 1.);
+}
+
+float prand(int *seed)
+{
+ int i = ((*seed = *seed * 1103515245 + 12345)>>16) & 077777;
+ return((float)i/32768.);
+}