Next: PSX_TIME - Get the current calendar time
Up: Routine Descriptions
Previous: PSX_REALLOC - Change the size of an allocated region of virtual memory
PSX_SRAND
- Set the seed for the random number generator
- Description:
- The argument SEED is used to set a new seed for the sequence of
random numbers returned by the subroutine PSX_RAND. If PSX_SRAND
is called with the same value of SEED, then the values returned by
subsequent calls to
PSX_RAND will be the same. If PSX_RAND is
called before calling PSX_SRAND, then the sequence of random
number returned by PSX_RAND will be the same as if PSX_SRAND had
been called with SEED set to one.
- Invocation:
- CALL PSX_SRAND( SEED, STATUS )
- Arguments:
-
-
SEED = INTEGER (Given)
-
The seed for the random number generator.
-
STATUS = INTEGER (Given and Returned)
-
The global status.
- Notes:
- The range of values allowed for SEED is not specified. It is
unlikely that values between 1 and the maximum integral value
that PSX_RAND can return will cause problems.
-
References
- POSIX standard (1988), section 8.1
- ANSI C standard (1989), section 4.10.2.2
-
Copyright
- Copyright (C) 1991 Science & Engineering Research Council
Next: PSX_TIME - Get the current calendar time
Up: Routine Descriptions
Previous: PSX_REALLOC - Change the size of an allocated region of virtual memory
PSX POSIX interface routines
Starlink User Note 121
P M Allan
A J Chipperfield
10 April 2003
E-mail:ussc@star.rl.ac.uk
Copyright © 2000 Council for the Central Laboratory of the Research Councils