01.01.2013 Views

AT&T UNIX™PC Unix System V Users Manual - tenox

AT&T UNIX™PC Unix System V Users Manual - tenox

AT&T UNIX™PC Unix System V Users Manual - tenox

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

RAND ( 3C ) RAND ( 3C )<br />

NAME<br />

rand, srand - simple random-number generator<br />

SYNOPSIS<br />

int rand ( )<br />

void srand (seed)<br />

unsigned seed;<br />

DESCRIPTION<br />

Rand uses a multiplicative congruential random-number generator<br />

with period 232 that returns successive pseudo-random numbers in<br />

the range from 0 to 211;_ 1 .<br />

Brand can be called at any time to reset the random-number generator<br />

to a random starting point. The generator is initially<br />

seeded with a value of 1 .<br />

NOTE<br />

The spectral properties of rand leave a great deal to be desired.<br />

Drand48(3C) provides a much better, though more elaborate,<br />

random-number generator.<br />

SEE ALSO<br />

drand48(3C).<br />

- 1 -

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!