Compaq Fortran for Tru64 UNIX Alpha Systems V5.4

rand, drand, irand, srand (3f)


Syntax

  integer*4 irand, i, iseed
  real*4 rand, x
  real*8 drand, d
  external rand, drand, irand, srand
  ...
  call srand ( iseed )
  i = irand( )
  x = rand( )
  d = drand( )

Description

  The rand and drand functions generate pseudo-random numbers distributed in
  [0, 1.0].

  The irand function generates successive pseudo-random integers in the range
  0 to 2**15-1.

  The srand function uses its integer argument to reinitialize the seed for
  successive invocations of rand, drand, and irand.

See Also

  rand(3)