diff options
Diffstat (limited to 'src/prng/lrand48.c')
-rw-r--r-- | src/prng/lrand48.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/prng/lrand48.c b/src/prng/lrand48.c new file mode 100644 index 00000000..a3c4e4e2 --- /dev/null +++ b/src/prng/lrand48.c @@ -0,0 +1,15 @@ +#include <stdlib.h> +#include <inttypes.h> + +uint64_t __rand48_step(unsigned short *xi, unsigned short *lc); +extern unsigned short __seed48[7]; + +long nrand48(unsigned short s[3]) +{ + return __rand48_step(s, __seed48+3) >> 17; +} + +long lrand48(void) +{ + return nrand48(__seed48); +} |