HELPLIB.HLB  —  CRTL  rand
    Returns pseudorandom numbers in the range 0 to 2[31] - 1.

    Format

      #include  <stdlib.h>

      int rand  (void);

      int rand_r  (unsigned int seed); (Integrity servers, Alpha)

1  –  Argument

 seed

    An initial seed value.

2  –  Description

    The rand function computes a sequence of pseudorandom integers in
    the range 0 to {RAND_MAX} with a period of at least 2[32].

    The rand_r function computes a sequence of pseudorandom integers
    in the range 0 to {RAND_MAX}. The value of the {RAND_MAX} macro
    will be at least 32767.

    If rand_r is called with the same initial value for the object
    pointed to by seed and that object is not modified between
    successive returns and calls to rand_r, the same sequence is
    generated.

    See also srand.

    For other random-number algorithms, see random and all the *48
    functions.

3  –  Return Value

    n                  A pseudorandom number.
Close Help