1: /*
   2:  * Copyright (c) 1980 Regents of the University of California.
   3:  * All rights reserved.  The Berkeley software License Agreement
   4:  * specifies the terms and conditions for redistribution.
   5:  */
   6: 
   7: #if defined(LIBC_SCCS) && !defined(lint)
   8: static char sccsid[] = "@(#)rand.c	5.2 (Berkeley) 3/9/86";
   9: #endif LIBC_SCCS and not lint
  10: 
  11: static  long    randx = 1;
  12: 
  13: srand(x)
  14: unsigned x;
  15: {
  16:     randx = x;
  17: }
  18: 
  19: rand()
  20: {
  21: #ifdef pdp11
  22:     return(((randx = randx * 1103515245 + 12345)>>16) & 0x7fff);
  23: #else
  24:     return((randx = randx * 1103515245 + 12345) & 0x7fffffff);
  25: #endif
  26: }

Defined functions

Defined variables

randx defined in line 11; used 5 times
sccsid defined in line 8; never used
Last modified: 1987-07-12
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: ?E00
Valid CSS Valid XHTML 1.0 Strict