Changeset View
Changeset View
Standalone View
Standalone View
lib/libc/gen/mrand48.c
| Show All 9 Lines | |||||
| * of any kind. I shall in no event be liable for anything that happens | * of any kind. I shall in no event be liable for anything that happens | ||||
| * to anyone/anything when using this software. | * to anyone/anything when using this software. | ||||
| */ | */ | ||||
| #include <stdint.h> | #include <stdint.h> | ||||
| #include "rand48.h" | #include "rand48.h" | ||||
| extern unsigned short _rand48_seed[3]; | |||||
| long | long | ||||
| mrand48(void) | mrand48(void) | ||||
| { | { | ||||
| _DORAND48(_rand48_seed); | |||||
| _dorand48(_rand48_seed); | return ((int)((_rand48_seed >> 16) & 0xffffffff)); | ||||
| return ((int32_t)(((uint32_t)_rand48_seed[2] << 16) | | |||||
| (uint32_t)_rand48_seed[1])); | |||||
| } | } | ||||