Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ rand(3C-ucb) — Reliant UNIX 5.44c4

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

random(3)

drand48(3C)

rand(3C)

srand(3C)

rand(3C-ucb)            (BSD Compatibility Package)            rand(3C-ucb)

NAME
     rand, srand - simple random-number generator

SYNOPSIS
     /usr/ucb/cc [ flag... ] file ... -lucb

     srand(seed)
     int seed;

     rand()

DESCRIPTION
     rand uses a multiplicative congruent random-number generator with
     period 2^32 to return successive pseudo-random numbers in the range
     from 0 to (2^31)-1.

     srand can be called at any time to reset the random-number generator
     to a random starting point. The generator is initially seeded with a
     value of 1.

NOTES
     The spectral properties of rand leave a great deal to be desired.
     drand48 and random provide much better, though more elaborate,
     random-number generators.

     The low bits of the numbers generated are not very random; use the
     middle bits. In particular the lowest bit alternates between 0 and 1.

SEE ALSO
     random(3), drand48(3C), rand(3C), srand(3C).

























Page 1                       Reliant UNIX 5.44                Printed 11/98

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