blob: 0519d6676de261d9411bb87ca3eca1215ec8b9cc [file] [log] [blame]
Rich Felker0b44a032011-02-12 00:22:29 -05001#include <stdlib.h>
2#include <inttypes.h>
3
4uint64_t __rand48_step(unsigned short *xi, unsigned short *lc);
5extern unsigned short __seed48[7];
6
7long jrand48(unsigned short s[3])
8{
Rich Felkeradfe6822016-12-16 23:19:27 -05009 return (int32_t)(__rand48_step(s, __seed48+3) >> 16);
Rich Felker0b44a032011-02-12 00:22:29 -050010}
11
12long mrand48(void)
13{
14 return jrand48(__seed48);
15}