BSD 4_4 development
[unix-history] / usr / share / man / cat3 / rand.0
RAND(3) BSD Programmer's Manual RAND(3)
N\bNA\bAM\bME\bE
r\bra\ban\bnd\bd, s\bsr\bra\ban\bnd\bd - bad random number generator
S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS
#\b#i\bin\bnc\bcl\blu\bud\bde\be <\b<s\bst\btd\bdl\bli\bib\bb.\b.h\bh>\b>
_\bv_\bo_\bi_\bd
s\bsr\bra\ban\bnd\bd(_\bu_\bn_\bs_\bi_\bg_\bn_\be_\bd _\bs_\be_\be_\bd);
_\bi_\bn_\bt
r\bra\ban\bnd\bd(_\bv_\bo_\bi_\bd);
D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
T\bTh\bhe\bes\bse\be i\bin\bnt\bte\ber\brf\bfa\bac\bce\bes\bs a\bar\bre\be o\bob\bbs\bso\bol\ble\bet\bte\bed\bd b\bby\by r\bra\ban\bnd\bdo\bom\bm(\b(3\b3)\b).\b.
The r\bra\ban\bnd\bd() function computes a sequence of pseudo-random integers in the
range of 0 to RAND_MAX (as defined by the header file <_\bs_\bt_\bd_\bl_\bi_\bb_\b._\bh>).
The s\bsr\bra\ban\bnd\bd() function sets its argument as the seed for a new sequence of
pseudo-random numbers to be returned by r\bra\ban\bnd\bd(). These sequences are re-
peatable by calling s\bsr\bra\ban\bnd\bd() with the same seed value.
If no seed value is provided, the functions are automatically seeded with
a value of 1.
S\bSE\bEE\bE A\bAL\bLS\bSO\bO
random(3)
S\bST\bTA\bAN\bND\bDA\bAR\bRD\bDS\bS
The r\bra\ban\bnd\bd() and s\bsr\bra\ban\bnd\bd() functions conform to ANSI C X3.159-1989 (``ANSI C
'').
4.4BSD June 4, 1993 1