aboutsummaryrefslogtreecommitdiff
path: root/lib/PenroseRand.c
diff options
context:
space:
mode:
authorHans-Christoph Steiner <eighthave@users.sourceforge.net>2006-02-09 16:18:39 +0000
committerHans-Christoph Steiner <eighthave@users.sourceforge.net>2006-02-09 16:18:39 +0000
commitb418fb91e7bb45d7b5f1eb8b19703441ae94eb13 (patch)
tree3f4a32d0b99d4ea0ac602bec59f0d2accba46719 /lib/PenroseRand.c
got everything building and working, including building single-object/single-file objects with a shared dylib. Now got to get it integrated into the build systemsvn2git-root
svn path=/trunk/externals/fftease/; revision=4574
Diffstat (limited to 'lib/PenroseRand.c')
-rw-r--r--lib/PenroseRand.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/PenroseRand.c b/lib/PenroseRand.c
new file mode 100644
index 0000000..98f396e
--- /dev/null
+++ b/lib/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.);
+}