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:  *	@(#)random_.c	5.2	6/7/85
   7:  *
   8:  * Routines to return random values
   9:  *
  10:  * calling sequence:
  11:  *	double precision d, drandm
  12:  *	i = irandm(iflag)
  13:  *	x = random(iflag)
  14:  *	d = drandm(iflag)
  15:  * where:
  16:  *	If arg is nonzero, generator is restarted and value is returned.
  17:  *	If arg is 0, next value is returned.
  18:  *	Integer values will range from 0 thru 2147483647 (see random(3)).
  19:  *	Real values will range from 0.0 thru 1.0 .
  20:  */
  21: 
  22: #if vax
  23: #define RANDMAX     2147483647
  24: #else   vax
  25: #if pdp11
  26: #define RANDMAX     2147483647
  27: #else
  28:     UNKNOWN MACHINE!
  29: #endif	pdp11
  30: #endif	vax
  31: 
  32: long irandm_(iarg)
  33: long *iarg;
  34: {
  35:     if (*iarg) srandom((int)*iarg);
  36:     return( random() );
  37: }
  38: 
  39: float random_(iarg)
  40: long *iarg;
  41: {
  42:     if (*iarg) srandom((int)*iarg);
  43:     return( (float)(random())/(float)RANDMAX );
  44: }
  45: 
  46: double drandm_(iarg)
  47: long *iarg;
  48: {
  49:     if (*iarg) srandom((int)*iarg);
  50:     return( (double)(random())/(double)RANDMAX );
  51: }

Defined functions

drandm_ defined in line 46; never used
irandm_ defined in line 28; never used
random_ defined in line 39; never used

Defined macros

RANDMAX defined in line 26; used 2 times
Last modified: 1987-02-22
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 1427
Valid CSS Valid XHTML 1.0 Strict