Fortran Wiki
random_number

Description

Returns a single pseudorandom number or an array of pseudorandom numbers from the uniform distribution over the range 0x<10 \leq x \lt 1.

Standard

Fortran 95 and later

Class

Subroutine

Syntax

random_number(harvest)

Arguments

  • harvest - Shall be a scalar or an array of type real.

Example

program test_random_number
  real :: r(5,5)
  call random_number(r)
end program

See also

random_seed

category: intrinsics