Changeset View
Changeset View
Standalone View
Standalone View
lib/libc/gen/nrand48.c
| Show All 10 Lines | |||||
| * to anyone/anything when using this software. | * to anyone/anything when using this software. | ||||
| */ | */ | ||||
| #include "rand48.h" | #include "rand48.h" | ||||
| long | long | ||||
| nrand48(unsigned short xseed[3]) | nrand48(unsigned short xseed[3]) | ||||
| { | { | ||||
| _dorand48(xseed); | uint48 tmp; | ||||
| return ((long) xseed[2] << 15) + ((long) xseed[1] >> 1); | |||||
| DORAND48(tmp, xseed); | |||||
| return ((tmp >> 17) & 0x7fffffff); | |||||
| } | } | ||||