Intel® Fortran Compiler 18.0 Developer Guide and Reference

RANF Intrinsic Procedure

Elemental Intrinsic Function (Generic): Generates a random number between 0.0 and RAND_MAX. This function must not be passed as an actual argument. RANF can be used as an intrinsic procedure or as a portability routine. It is an intrinsic procedure unless you specify USE IFPORT.

result = RANF ()

Results

The result type is REAL(4). The result value is a single-precision pseudo-random number between 0.0 and (2**31) - 1.

The initial seed is set by the following:

  CALL SRAND(ISEED)

where ISEED is type INTEGER(4).

The intrinsic function RANF generates a different sequence of random numbers than the RANF portability function generates for the same seed. The intrinsic function RANF used inside a loop can be vectorized into one call that returns four results, but the portability function RANF cannot be so optimized.

See Also