xref: /freebsd/lib/libc/gen/nrand48.c (revision 559a218c9b257775fb249b67945fe4a05b7a6b9f)
14b4b7d05SGarrett Wollman /*
24b4b7d05SGarrett Wollman  * Copyright (c) 1993 Martin Birgmeier
34b4b7d05SGarrett Wollman  * All rights reserved.
44b4b7d05SGarrett Wollman  *
54b4b7d05SGarrett Wollman  * You may redistribute unmodified or modified versions of this source
64b4b7d05SGarrett Wollman  * code provided that the above copyright notice and this and the
74b4b7d05SGarrett Wollman  * following conditions are retained.
84b4b7d05SGarrett Wollman  *
94b4b7d05SGarrett Wollman  * This software is provided ``as is'', and comes with no warranties
104b4b7d05SGarrett Wollman  * of any kind. I shall in no event be liable for anything that happens
114b4b7d05SGarrett Wollman  * to anyone/anything when using this software.
124b4b7d05SGarrett Wollman  */
134b4b7d05SGarrett Wollman 
144b4b7d05SGarrett Wollman #include "rand48.h"
154b4b7d05SGarrett Wollman 
164b4b7d05SGarrett Wollman long
nrand48(unsigned short xseed[3])174b4b7d05SGarrett Wollman nrand48(unsigned short xseed[3])
184b4b7d05SGarrett Wollman {
194b4b7d05SGarrett Wollman 	_dorand48(xseed);
204b4b7d05SGarrett Wollman 	return ((long) xseed[2] << 15) + ((long) xseed[1] >> 1);
214b4b7d05SGarrett Wollman }
22