lrand48.c revision 1.7
11.7Smycroft/* $NetBSD: lrand48.c,v 1.7 2000/01/22 22:19:19 mycroft 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.4Sjtc#include "namespace.h" 171.1Sbrezak#include "rand48.h" 181.1Sbrezak 191.4Sjtc#ifdef __weak_alias 201.7Smycroft__weak_alias(lrand48,_lrand48) 211.4Sjtc#endif 221.1Sbrezak 231.1Sbrezaklong 241.1Sbrezaklrand48(void) 251.1Sbrezak{ 261.3Sjtc __dorand48(__rand48_seed); 271.6Schristos return (long)((unsigned long) __rand48_seed[2] << 15) + 281.6Schristos ((unsigned long) __rand48_seed[1] >> 1); 291.1Sbrezak} 30