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

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


SEE ALSO

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


PTC MKS Toolkit 10.4 Documentation Build 39.