random()

generate better random numbers 

Function


SYNOPSIS

#include <stdlib.h>

long random(void);


DESCRIPTION

This function uses a non-linear additive feedback random number generator employing a default table (state table) of size 31 long integers to return successive pseudo-random numbers in the range from 0 to 2^32-1. The period of this random number generator is very large, approximately 16*(2^32-1). The size of the state table determines the period of the random number generator. The values in the state table can be set by calling srandom().


PARAMETERS

None.


RETURN VALUES

random() returns a pseudo-random number between 0 and 2^32-1.


CONFORMANCE

UNIX 98.


MULTITHREAD SAFETY LEVEL

Unsafe.


PORTING ISSUES

None.


AVAILABILITY

MKS Toolkit for Professional Developers
MKS Toolkit for Enterprise Developers
MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
initstate(), rand(), rand_r(), setstate(), srand(), srandom()


MKS Toolkit 9.3 Documentation Build 6.