1994-09-23 00:37:55 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 1993 Martin Birgmeier
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* You may redistribute unmodified or modified versions of this source
|
|
|
|
* code provided that the above copyright notice and this and the
|
|
|
|
* following conditions are retained.
|
|
|
|
*
|
|
|
|
* This software is provided ``as is'', and comes with no warranties
|
|
|
|
* of any kind. I shall in no event be liable for anything that happens
|
|
|
|
* to anyone/anything when using this software.
|
|
|
|
*/
|
|
|
|
|
2002-03-22 21:53:29 +00:00
|
|
|
#include <sys/cdefs.h>
|
|
|
|
__FBSDID("$FreeBSD$");
|
|
|
|
|
2016-12-06 19:08:29 +00:00
|
|
|
#include <stdint.h>
|
|
|
|
|
1994-09-23 00:37:55 +00:00
|
|
|
#include "rand48.h"
|
|
|
|
|
|
|
|
extern unsigned short _rand48_seed[3];
|
|
|
|
|
|
|
|
long
|
|
|
|
mrand48(void)
|
|
|
|
{
|
2016-12-06 19:08:29 +00:00
|
|
|
|
1994-09-23 00:37:55 +00:00
|
|
|
_dorand48(_rand48_seed);
|
2016-12-06 19:08:29 +00:00
|
|
|
return ((int32_t)(((uint32_t)_rand48_seed[2] << 16) |
|
|
|
|
(uint32_t)_rand48_seed[1]));
|
1994-09-23 00:37:55 +00:00
|
|
|
}
|