RAND() (IBM extension)

Purpose

Not recommended. Generates uniform random numbers, positive real numbers greater than or equal to 0.0 and less than 1.0. Instead, use the standards conforming RANDOM_NUMBER(HARVEST) intrinsic subroutine.

Class

None (does not correspond to any of the defined categories).

Result type and attributes

real(4) scalar.

Related information

SRAND(SEED) (IBM extension) can be used to specify a seed value for the random number sequence.

If the function result is assigned to an array, all array elements receive the same value.

Examples

The following is an example of a program using the RAND function.
DO I = 1, 5
   R = RAND()
   PRINT *, R
ENDDO
END
The following is sample output generated by the above program:
0.2251586914
0.8285522461
0.6456298828
0.2496948242
0.2215576172

This function only has a specific name.