summaryrefslogtreecommitdiff
path: root/src/prng/mrand48.c
diff options
context:
space:
mode:
authorVladimir Azarov <avm@intermediate-node.net>2024-10-01 15:47:05 +0200
committerVladimir Azarov <avm@intermediate-node.net>2024-10-01 15:47:05 +0200
commit4abab5ad6c8465a7528ccdd5f49367da05f78bbd (patch)
treeebf009bf1376a5a223a915bc27cbbd791a1316bc /src/prng/mrand48.c
Initial version
Diffstat (limited to 'src/prng/mrand48.c')
-rw-r--r--src/prng/mrand48.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/prng/mrand48.c b/src/prng/mrand48.c
new file mode 100644
index 0000000..f4a56e6
--- /dev/null
+++ b/src/prng/mrand48.c
@@ -0,0 +1,13 @@
+#include <stdlib.h>
+#include <inttypes.h>
+#include "rand48.h"
+
+long jrand48(unsigned short s[3])
+{
+ return (int32_t)(__rand48_step(s, __seed48+3) >> 16);
+}
+
+long mrand48(void)
+{
+ return jrand48(__seed48);
+}