Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ rand(3C) — sys5 — Apollo

Media Vault

Software Library

Restoration Projects

Artifacts Sought



RAND(3C)        DOMAIN/IX Reference Manual (SYS5)        RAND(3C)



NAME
     rand, srand - simple random-number generator

USAGE
     int rand ( )

     void srand (seed)
     unsigned seed;

DESCRIPTION
     Rand uses a multiplicative congruential random-number gen-
                              32
     erator with a period of 2   that returns successive pseudo-
                                            15
     random numbers in the range from 0 to 2  -1.

     Calling srand at any time resets the random-number generator
     to a random starting point.  The generator is seeded ini-
     tially with a value of 1.

NOTES
     Drand48(3C) provides a much better, though more elaborate,
     random-number generator.

RELATED INFORMATION
     drand48(3C)































Printed 5/10/85                                            RAND-1


Typewritten Software • bear@typewritten.org • Edmonds, WA 98026