SEED

Portability Subroutine: Changes the starting point of the pseudorandom number generator.

Module

USE IFPORT

構文

CALL SEED (iseed)

iseed

(Input) INTEGER(4). Starting point for RANDOM.

SEED uses iseed to establish the starting point of the pseudorandom number generator. A given seed always produces the same sequence of values from RANDOM.

If SEED is not called before the first call to RANDOM, RANDOM always begins with a seed value of one. If a program must have a different pseudorandom sequence each time it runs, pass the constant RND$TIMESEED (defined in IFPORT.F90) to the SEED routine before the first call to RANDOM.

This routine is not thread-safe.

Compatibility

CONSOLE STANDARD GRAPHICS QUICKWIN GRAPHICS WINDOWS DLL LIB

 USE IFPORT
 REAL myrand
 CALL SEED(7531)
 CALL RANDOM(myrand)

関連情報


このヘルプトピックについてのフィードバックを送信

© 1996-2011 Intel Corporation. 無断での引用、転載を禁じます。