Compaq Fortran for Tru64 UNIX Alpha Systems V5.4

random, drandm, irandm (3f)


Syntax

  integer*4 irandm, rnum, iflag
  external irandm
  rnum = irandm ( iflag )

  real*4 random, rnum
  integer*4 iflag
  external random
  rnum = random ( iflag )

  real*8 drandm, drnum
  integer*4 iflag
  external drandm
  drnum = drandm ( iflag )

Description

  These functions use the random function to generate sequences of random
  numbers; they should be used rather than the older functions described in
  rand(3f.) If iflag is not zero, it is used as a new seed for the random
  number generator, and the first new random value is returned.

  The irandm function returns positive integers in the range 0 through
  2147483647 (2**31-1).  The random and drandm functions return values in the
  range 0.0 through 1.0 by dividing the integer random number from random(3)
  by 2147483647.

See Also

  random(3)