XL Fortran for AIX 8.1

Language Reference

+-------------------------------IBM Extension--------------------------------+


SRAND(SEED)

Provides the seed value used by the random number generator function RAND.

SEED
must be scalar. It must be of type REAL(4) when used to provide a seed value for the RAND function, or of type INTEGER(4) when used to provide a seed value for the IRAND service and utility function. It is an INTENT(IN) argument.

Class

Subroutine

Examples

The following is an example of a program using the SRAND subroutine.

CALL SRAND(0.5)
DO I = 1, 5
   R = RAND()
   PRINT *,R
ENDDO
END

The following is sample output generated by the above program:

0.3984375000
0.4048461914
0.1644897461
0.1281738281E-01
0.2313232422E-01

+----------------------------End of IBM Extension----------------------------+


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]