summaryrefslogtreecommitdiff
path: root/src/prng/mrand48.c
blob: 0519d6676de261d9411bb87ca3eca1215ec8b9cc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <stdlib.h>
#include <inttypes.h>

uint64_t __rand48_step(unsigned short *xi, unsigned short *lc);
extern unsigned short __seed48[7];

long jrand48(unsigned short s[3])
{
	return (int32_t)(__rand48_step(s, __seed48+3) >> 16);
}

long mrand48(void)
{
	return jrand48(__seed48);
}