1 1.4 perry /* $NetBSD: nrand48.c,v 1.4 1998/01/09 03:15:39 perry Exp $ */ 2 1.4 perry 3 1.1 brezak /* 4 1.1 brezak * Copyright (c) 1993 Martin Birgmeier 5 1.1 brezak * All rights reserved. 6 1.1 brezak * 7 1.1 brezak * You may redistribute unmodified or modified versions of this source 8 1.1 brezak * code provided that the above copyright notice and this and the 9 1.1 brezak * following conditions are retained. 10 1.1 brezak * 11 1.1 brezak * This software is provided ``as is'', and comes with no warranties 12 1.1 brezak * of any kind. I shall in no event be liable for anything that happens 13 1.1 brezak * to anyone/anything when using this software. 14 1.1 brezak */ 15 1.1 brezak 16 1.3 jtc #include "namespace.h" 17 1.1 brezak #include "rand48.h" 18 1.3 jtc 19 1.3 jtc #ifdef __weak_alias 20 1.3 jtc __weak_alias(nrand48,_nrand48); 21 1.3 jtc #endif 22 1.1 brezak 23 1.1 brezak long 24 1.1 brezak nrand48(unsigned short xseed[3]) 25 1.1 brezak { 26 1.2 jtc __dorand48(xseed); 27 1.1 brezak return ((long) xseed[2] << 15) + ((long) xseed[1] >> 1); 28 1.1 brezak } 29