HP C/iX Library Reference Manual (30026-90004)
Chapter 5 285
HP C/iX Library Function Descriptions
rand
rand
Returns a random number.
Syntax
#include <stdlib.h>
int rand (void);
Parameters
None.
Return Values
x A pseudo-random integer in the range 0 to RAND_MAX. The macro RAND_MAX
expands to the value 32767.
Description
If the srand function is not used to initialize the random number generator to a particular
starting point, rand() returns the same sequence of numbers every time the program is
executed.
See Also
rand(), srand(), ANSI C 4.10.2.1, POSIX.1 8.1