LF Fortran 95

RANDOM_NUMBER Subroutine

Description

The RANDOM_NUMBER subroutine returns a uniformly distributed pseudorandom number or numbers in the range 0 ≤ x < 1 .

    

Syntax

RANDOM_NUMBER (harvest)

Arguments

harvest is an INTENT(OUT) scalar or array of type REAL. On return, its value is a set of pseudorandom numbers uniformly distributed in the range 0 ≤ x < 1 .

Remarks

The random number generator uses a multiplicative congruential algorithm with a period of approximately 238

    

Example

call random_number(x) ! each element of x is assigned ! a pseudorandom number

See Also

RANDOM_SEED Subroutine