lrand48.c revision 1.4
11.1Sbrezak/*
21.1Sbrezak * Copyright (c) 1993 Martin Birgmeier
31.1Sbrezak * All rights reserved.
41.1Sbrezak *
51.1Sbrezak * You may redistribute unmodified or modified versions of this source
61.1Sbrezak * code provided that the above copyright notice and this and the
71.1Sbrezak * following conditions are retained.
81.1Sbrezak *
91.1Sbrezak * This software is provided ``as is'', and comes with no warranties
101.1Sbrezak * of any kind. I shall in no event be liable for anything that happens
111.1Sbrezak * to anyone/anything when using this software.
121.1Sbrezak */
131.1Sbrezak
141.4Sjtc#include "namespace.h"
151.1Sbrezak#include "rand48.h"
161.1Sbrezak
171.4Sjtc#ifdef __weak_alias
181.4Sjtc__weak_alias(lrand48,_lrand48);
191.4Sjtc#endif
201.1Sbrezak
211.1Sbrezaklong
221.1Sbrezaklrand48(void)
231.1Sbrezak{
241.3Sjtc	__dorand48(__rand48_seed);
251.3Sjtc	return ((long) __rand48_seed[2] << 15) + ((long) __rand48_seed[1] >> 1);
261.1Sbrezak}
27