lrand48.c revision 1.9
11.9Smatt/*	$NetBSD: lrand48.c,v 1.9 2013/10/22 08:08:51 matt Exp $	*/
21.5Sperry
31.1Sbrezak/*
41.1Sbrezak * Copyright (c) 1993 Martin Birgmeier
51.1Sbrezak * All rights reserved.
61.1Sbrezak *
71.1Sbrezak * You may redistribute unmodified or modified versions of this source
81.1Sbrezak * code provided that the above copyright notice and this and the
91.1Sbrezak * following conditions are retained.
101.1Sbrezak *
111.1Sbrezak * This software is provided ``as is'', and comes with no warranties
121.1Sbrezak * of any kind. I shall in no event be liable for anything that happens
131.1Sbrezak * to anyone/anything when using this software.
141.1Sbrezak */
151.1Sbrezak
161.8Slukem#include <sys/cdefs.h>
171.8Slukem#if defined(LIBC_SCCS) && !defined(lint)
181.9Smatt__RCSID("$NetBSD: lrand48.c,v 1.9 2013/10/22 08:08:51 matt Exp $");
191.8Slukem#endif /* LIBC_SCCS and not lint */
201.8Slukem
211.4Sjtc#include "namespace.h"
221.1Sbrezak#include "rand48.h"
231.1Sbrezak
241.4Sjtc#ifdef __weak_alias
251.7Smycroft__weak_alias(lrand48,_lrand48)
261.4Sjtc#endif
271.1Sbrezak
281.1Sbrezaklong
291.1Sbrezaklrand48(void)
301.1Sbrezak{
311.3Sjtc	__dorand48(__rand48_seed);
321.9Smatt	return __rand48_seed[2] * 32768 + (__rand48_seed[1] >> 1);
331.1Sbrezak}
34