srand man page on SunOS

Man page or keyword search:  
man Server   20652 pages
apropos Keyword Search (all sections)
Output format
SunOS logo
[printable version]

rand(3UCB)	   SunOS/BSD Compatibility Library Functions	    rand(3UCB)

NAME
       rand, srand - simple random number generator

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

       int rand();

       int srand(seed)
       unsigned seed;

DESCRIPTION
       rand()  uses a multiplicative congruential 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.

SEE ALSO
       cc(1B), drand48(3C), rand(3C), random(3C)

NOTES
       Use of these interfaces should be restricted to only applications writ‐
       ten on BSD platforms.  Use of these interfaces with any of  the	system
       libraries or in multi-thread applications is unsupported.

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

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

SunOS 5.10			  30 Oct 2007			    rand(3UCB)
[top]

List of man pages available for SunOS

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net