JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
* mt.c: Added (Mersenne Twister random number generator).
[vor.git] / mt.h
diff --git a/mt.h b/mt.h
new file mode 100644 (file)
index 0000000..f7ac92a
--- /dev/null
+++ b/mt.h
@@ -0,0 +1,11 @@
+#ifndef VOR_MT_H
+#define VOR_MT_H
+
+#include <stdint.h>
+
+void init_mt(uint32_t s);
+uint32_t irnd(void); // [0, 0xfffffff]
+float frnd(void);  // [0, 1)
+float crnd(void);  // [-0.5, 0.5)
+
+#endif // VOR_MT_H