11.9Smatt/*	$NetBSD: jrand48.c,v 1.9 2013/10/22 08:08:51 matt Exp $	*/
21.4Sperry
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: jrand48.c,v 1.9 2013/10/22 08:08:51 matt Exp $");
191.8Slukem#endif /* LIBC_SCCS and not lint */
201.8Slukem
211.3Sjtc#include "namespace.h"
221.5Slukem
231.5Slukem#include <assert.h>
241.5Slukem
251.1Sbrezak#include "rand48.h"
261.3Sjtc
271.3Sjtc#ifdef __weak_alias
281.7Smycroft__weak_alias(jrand48,_jrand48)
291.3Sjtc#endif
301.1Sbrezak
311.1Sbrezaklong
321.1Sbrezakjrand48(unsigned short xseed[3])
331.1Sbrezak{
341.5Slukem
351.5Slukem	_DIAGASSERT(xseed != NULL);
361.5Slukem
371.2Sjtc	__dorand48(xseed);
381.9Smatt	return (int16_t)xseed[2] * 65536 + xseed[1];
391.1Sbrezak}
40