|
|
DataMuseum.dkPresents historical artifacts from the history of: RC9000 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about RC9000 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - downloadIndex: r
Length: 5079 (0x13d7)
Names: »random.3«
└─⟦50656ff4a⟧ Bits:30010538 TX 3.1 Coldstart
└─⟦bbf173f5c⟧ »0004«
└─⟦this⟧ »./bsd/usr/man/cat3/random.3«
└─⟦this⟧ »./usr/man/cat3/random.3«
0x0000…0020 0a 0a 0a 5f 08 4f 5f 08 6e 5f 08 6c 5f 08 69 5f 08 6e 5f 08 65 20 5f 08 4d 5f 08 61 5f 08 6e 5f ┆ _ O_ n_ l_ i_ n_ e _ M_ a_ n_┆ 0x0020…0040 08 75 5f 08 61 5f 08 6c 20 20 20 20 20 20 20 20 20 20 20 4c 69 62 72 61 72 79 20 46 75 6e 63 74 ┆ u_ a_ l Library Funct┆ 0x0040…0060 69 6f 6e 73 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 61 6e 64 6f 6d 28 33 29 0a 0a 0a 0a ┆ions random(3) ┆ 0x0060…0080 4e 08 4e 08 4e 08 4e 41 08 41 08 41 08 41 4d 08 4d 08 4d 08 4d 45 08 45 08 45 08 45 0a 20 20 20 ┆N N N NA A A AM M M ME E E E ┆ 0x0080…00a0 20 20 72 61 6e 64 6f 6d 2c 20 73 72 61 6e 64 6f 6d 2c 20 69 6e 69 74 73 74 61 74 65 2c 20 73 65 ┆ random, srandom, initstate, se┆ 0x00a0…00c0 74 73 74 61 74 65 20 2d 20 62 65 74 74 65 72 20 72 61 6e 64 6f 6d 20 6e 75 6d 62 65 72 0a 20 20 ┆tstate - better random number ┆ 0x00c0…00e0 20 20 20 67 65 6e 65 72 61 74 6f 72 3b 20 72 6f 75 74 69 6e 65 73 20 66 6f 72 20 63 68 61 6e 67 ┆ generator; routines for chang┆ 0x00e0…0100 69 6e 67 20 67 65 6e 65 72 61 74 6f 72 73 0a 0a 53 08 53 08 53 08 53 59 08 59 08 59 08 59 4e 08 ┆ing generators S S S SY Y Y YN ┆ 0x0100…0120 4e 08 4e 08 4e 54 08 54 08 54 08 54 41 08 41 08 41 08 41 58 08 58 08 58 08 58 0a 20 20 20 20 20 ┆N N NT T T TA A A AX X X X ┆ 0x0120…0140 6c 08 6c 08 6c 08 6c 6f 08 6f 08 6f 08 6f 6e 08 6e 08 6e 08 6e 67 08 67 08 67 08 67 20 72 08 72 ┆l l l lo o o on n n ng g g g r r┆ 0x0140…0160 08 72 08 72 61 08 61 08 61 08 61 6e 08 6e 08 6e 08 6e 64 08 64 08 64 08 64 6f 08 6f 08 6f 08 6f ┆ r ra a a an n n nd d d do o o o┆ 0x0160…0180 6d 08 6d 08 6d 08 6d 28 08 28 08 28 08 28 29 08 29 08 29 08 29 0a 0a 20 20 20 20 20 73 08 73 08 ┆m m m m( ( ( () ) ) ) s s ┆ 0x0180…01a0 73 08 73 72 08 72 08 72 08 72 61 08 61 08 61 08 61 6e 08 6e 08 6e 08 6e 64 08 64 08 64 08 64 6f ┆s sr r r ra a a an n n nd d d do┆ 0x01a0…01c0 08 6f 08 6f 08 6f 6d 08 6d 08 6d 08 6d 28 08 28 08 28 08 28 73 08 73 08 73 08 73 65 08 65 08 65 ┆ o o om m m m( ( ( (s s s se e e┆ 0x01c0…01e0 08 65 65 08 65 08 65 08 65 64 08 64 08 64 08 64 29 08 29 08 29 08 29 0a 20 20 20 20 20 69 08 69 ┆ ee e e ed d d d) ) ) ) i i┆ 0x01e0…0200 08 69 08 69 6e 08 6e 08 6e 08 6e 74 08 74 08 74 08 74 20 73 08 73 08 73 08 73 65 08 65 08 65 08 ┆ i in n n nt t t t s s s se e e ┆ 0x0200…0220 65 65 08 65 08 65 08 65 64 08 64 08 64 08 64 3b 08 3b 08 3b 08 3b 0a 0a 20 20 20 20 20 63 08 63 ┆ee e e ed d d d; ; ; ; c c┆ 0x0220…0240 08 63 08 63 68 08 68 08 68 08 68 61 08 61 08 61 08 61 72 08 72 08 72 08 72 20 2a 08 2a 08 2a 08 ┆ c ch h h ha a a ar r r r * * * ┆ 0x0240…0260 2a 69 08 69 08 69 08 69 6e 08 6e 08 6e 08 6e 69 08 69 08 69 08 69 74 08 74 08 74 08 74 73 08 73 ┆*i i i in n n ni i i it t t ts s┆ 0x0260…0280 08 73 08 73 74 08 74 08 74 08 74 61 08 61 08 61 08 61 74 08 74 08 74 08 74 65 08 65 08 65 08 65 ┆ s st t t ta a a at t t te e e e┆ 0x0280…02a0 28 08 28 08 28 08 28 73 08 73 08 73 08 73 65 08 65 08 65 08 65 65 08 65 08 65 08 65 64 08 64 08 ┆( ( ( (s s s se e e ee e e ed d ┆ 0x02a0…02c0 64 08 64 2c 08 2c 08 2c 08 2c 20 73 08 73 08 73 08 73 74 08 74 08 74 08 74 61 08 61 08 61 08 61 ┆d d, , , , s s s st t t ta a a a┆ 0x02c0…02e0 74 08 74 08 74 08 74 65 08 65 08 65 08 65 2c 08 2c 08 2c 08 2c 20 6e 08 6e 08 6e 08 6e 29 08 29 ┆t t t te e e e, , , , n n n n) )┆ 0x02e0…0300 08 29 08 29 0a 20 20 20 20 20 75 08 75 08 75 08 75 6e 08 6e 08 6e 08 6e 73 08 73 08 73 08 73 69 ┆ ) ) u u u un n n ns s s si┆ 0x0300…0320 08 69 08 69 08 69 67 08 67 08 67 08 67 6e 08 6e 08 6e 08 6e 65 08 65 08 65 08 65 64 08 64 08 64 ┆ i i ig g g gn n n ne e e ed d d┆ 0x0320…0340 08 64 20 73 08 73 08 73 08 73 65 08 65 08 65 08 65 65 08 65 08 65 08 65 64 08 64 08 64 08 64 3b ┆ d s s s se e e ee e e ed d d d;┆ 0x0340…0360 08 3b 08 3b 08 3b 0a 20 20 20 20 20 63 08 63 08 63 08 63 68 08 68 08 68 08 68 61 08 61 08 61 08 ┆ ; ; ; c c c ch h h ha a a ┆ 0x0360…0380 61 72 08 72 08 72 08 72 20 2a 08 2a 08 2a 08 2a 73 08 73 08 73 08 73 74 08 74 08 74 08 74 61 08 ┆ar r r r * * * *s s s st t t ta ┆ 0x0380…03a0 61 08 61 08 61 74 08 74 08 74 08 74 65 08 65 08 65 08 65 3b 08 3b 08 3b 08 3b 0a 20 20 20 20 20 ┆a a at t t te e e e; ; ; ; ┆ 0x03a0…03c0 69 08 69 08 69 08 69 6e 08 6e 08 6e 08 6e 74 08 74 08 74 08 74 20 6e 08 6e 08 6e 08 6e 3b 08 3b ┆i i i in n n nt t t t n n n n; ;┆ 0x03c0…03e0 08 3b 08 3b 0a 0a 20 20 20 20 20 63 08 63 08 63 08 63 68 08 68 08 68 08 68 61 08 61 08 61 08 61 ┆ ; ; c c c ch h h ha a a a┆ 0x03e0…0400 72 08 72 08 72 08 72 20 2a 08 2a 08 2a 08 2a 73 08 73 08 73 08 73 65 08 65 08 65 08 65 74 08 74 ┆r r r r * * * *s s s se e e et t┆ 0x0400…0420 08 74 08 74 73 08 73 08 73 08 73 74 08 74 08 74 08 74 61 08 61 08 61 08 61 74 08 74 08 74 08 74 ┆ t ts s s st t t ta a a at t t t┆ 0x0420…0440 65 08 65 08 65 08 65 28 08 28 08 28 08 28 73 08 73 08 73 08 73 74 08 74 08 74 08 74 61 08 61 08 ┆e e e e( ( ( (s s s st t t ta a ┆ 0x0440…0460 61 08 61 74 08 74 08 74 08 74 65 08 65 08 65 08 65 29 08 29 08 29 08 29 0a 20 20 20 20 20 63 08 ┆a at t t te e e e) ) ) ) c ┆ 0x0460…0480 63 08 63 08 63 68 08 68 08 68 08 68 61 08 61 08 61 08 61 72 08 72 08 72 08 72 20 2a 08 2a 08 2a ┆c c ch h h ha a a ar r r r * * *┆ 0x0480…04a0 08 2a 73 08 73 08 73 08 73 74 08 74 08 74 08 74 61 08 61 08 61 08 61 74 08 74 08 74 08 74 65 08 ┆ *s s s st t t ta a a at t t te ┆ 0x04a0…04c0 65 08 65 08 65 3b 08 3b 08 3b 08 3b 0a 0a 44 08 44 08 44 08 44 45 08 45 08 45 08 45 53 08 53 08 ┆e e e; ; ; ; D D D DE E E ES S ┆ 0x04c0…04e0 53 08 53 43 08 43 08 43 08 43 52 08 52 08 52 08 52 49 08 49 08 49 08 49 50 08 50 08 50 08 50 54 ┆S SC C C CR R R RI I I IP P P PT┆ 0x04e0…0500 08 54 08 54 08 54 49 08 49 08 49 08 49 4f 08 4f 08 4f 08 4f 4e 08 4e 08 4e 08 4e 0a 20 20 20 20 ┆ T T TI I I IO O O ON N N N ┆ 0x0500…0520 20 5f 08 72 5f 08 61 5f 08 6e 5f 08 64 5f 08 6f 5f 08 6d 20 75 73 65 73 20 61 20 6e 6f 6e 2d 6c ┆ _ r_ a_ n_ d_ o_ m uses a non-l┆ 0x0520…0540 69 6e 65 61 72 20 61 64 64 69 74 69 76 65 20 66 65 65 64 62 61 63 6b 20 72 61 6e 64 6f 6d 20 6e ┆inear additive feedback random n┆ 0x0540…0560 75 6d 62 65 72 0a 20 20 20 20 20 67 65 6e 65 72 61 74 6f 72 20 65 6d 70 6c 6f 79 69 6e 67 20 61 ┆umber generator employing a┆ 0x0560…0580 20 64 65 66 61 75 6c 74 20 74 61 62 6c 65 20 6f 66 20 73 69 7a 65 20 33 31 20 6c 6f 6e 67 20 69 ┆ default table of size 31 long i┆ 0x0580…05a0 6e 74 65 67 65 72 73 0a 20 20 20 20 20 74 6f 20 72 65 74 75 72 6e 20 73 75 63 63 65 73 73 69 76 ┆ntegers to return successiv┆ 0x05a0…05c0 65 20 70 73 65 75 64 6f 2d 72 61 6e 64 6f 6d 20 6e 75 6d 62 65 72 73 20 69 6e 20 74 68 65 20 72 ┆e pseudo-random numbers in the r┆ 0x05c0…05e0 61 6e 67 65 20 66 72 6f 6d 0a 20 20 20 20 20 30 20 74 6f 20 32 33 31 2d 31 2e 20 20 54 68 65 20 ┆ange from 0 to 231-1. The ┆ 0x05e0…0600 70 65 72 69 6f 64 20 6f 66 20 74 68 69 73 20 72 61 6e 64 6f 6d 20 6e 75 6d 62 65 72 20 67 65 6e ┆period of this random number gen┆ 0x0600…0620 65 72 61 74 6f 72 20 69 73 0a 20 20 20 20 20 76 65 72 79 20 6c 61 72 67 65 2c 20 61 70 70 72 6f ┆erator is very large, appro┆ 0x0620…0640 78 69 6d 61 74 65 6c 79 20 31 36 2a 28 32 33 31 2d 31 29 2e 0a 0a 20 20 20 20 20 5f 08 72 5f 08 ┆ximately 16*(231-1). _ r_ ┆ 0x0640…0660 61 5f 08 6e 5f 08 64 5f 08 6f 5f 08 6d 2f 5f 08 73 5f 08 72 5f 08 61 5f 08 6e 5f 08 64 5f 08 6f ┆a_ n_ d_ o_ m/_ s_ r_ a_ n_ d_ o┆ 0x0660…0680 5f 08 6d 20 68 61 76 65 20 28 61 6c 6d 6f 73 74 29 20 74 68 65 20 73 61 6d 65 20 63 61 6c 6c 69 ┆_ m have (almost) the same calli┆ 0x0680…06a0 6e 67 20 73 65 71 75 65 6e 63 65 20 61 6e 64 0a 20 20 20 20 20 69 6e 69 74 69 61 6c 69 7a 61 74 ┆ng sequence and initializat┆ 0x06a0…06c0 69 6f 6e 20 70 72 6f 70 65 72 74 69 65 73 20 61 73 20 5f 08 72 5f 08 61 5f 08 6e 5f 08 64 2f 5f ┆ion properties as _ r_ a_ n_ d/_┆ 0x06c0…06e0 08 73 5f 08 72 5f 08 61 5f 08 6e 5f 08 64 2e 20 54 68 65 20 64 69 66 66 65 72 65 6e 63 65 20 69 ┆ s_ r_ a_ n_ d. The difference i┆ 0x06e0…0700 73 0a 20 20 20 20 20 74 68 61 74 20 5f 08 72 5f 08 61 5f 08 6e 5f 08 64 28 33 29 20 70 72 6f 64 ┆s that _ r_ a_ n_ d(3) prod┆ 0x0700…0720 75 63 65 73 20 61 20 6d 75 63 68 20 6c 65 73 73 20 72 61 6e 64 6f 6d 20 73 65 71 75 65 6e 63 65 ┆uces a much less random sequence┆ 0x0720…0740 20 2d 2d 20 69 6e 0a 20 20 20 20 20 66 61 63 74 2c 20 74 68 65 20 6c 6f 77 20 64 6f 7a 65 6e 20 ┆ -- in fact, the low dozen ┆ 0x0740…0760 62 69 74 73 20 67 65 6e 65 72 61 74 65 64 20 62 79 20 72 61 6e 64 20 67 6f 20 74 68 72 6f 75 67 ┆bits generated by rand go throug┆ 0x0760…0780 68 20 61 0a 20 20 20 20 20 63 79 63 6c 69 63 20 70 61 74 74 65 72 6e 2e 20 20 41 6c 6c 20 74 68 ┆h a cyclic pattern. All th┆ 0x0780…07a0 65 20 62 69 74 73 20 67 65 6e 65 72 61 74 65 64 20 62 79 20 5f 08 72 5f 08 61 5f 08 6e 5f 08 64 ┆e bits generated by _ r_ a_ n_ d┆ 0x07a0…07c0 5f 08 6f 5f 08 6d 20 61 72 65 0a 20 20 20 20 20 75 73 61 62 6c 65 2e 20 20 46 6f 72 20 65 78 61 ┆_ o_ m are usable. For exa┆ 0x07c0…07e0 6d 70 6c 65 2c 20 22 72 61 6e 64 6f 6d 28 29 26 30 31 22 20 77 69 6c 6c 20 70 72 6f 64 75 63 65 ┆mple, "random()&01" will produce┆ 0x07e0…0800 20 61 20 72 61 6e 64 6f 6d 0a 20 20 20 20 20 62 69 6e 61 72 79 20 76 61 6c 75 65 2e 0a 0a 20 20 ┆ a random binary value. ┆ 0x0800…0820 20 20 20 55 6e 6c 69 6b 65 20 5f 08 73 5f 08 72 5f 08 61 5f 08 6e 5f 08 64 2c 20 5f 08 73 5f 08 ┆ Unlike _ s_ r_ a_ n_ d, _ s_ ┆ 0x0820…0840 72 5f 08 61 5f 08 6e 5f 08 64 5f 08 6f 5f 08 6d 20 64 6f 65 73 20 6e 6f 74 20 72 65 74 75 72 6e ┆r_ a_ n_ d_ o_ m does not return┆ 0x0840…0860 20 74 68 65 20 6f 6c 64 20 73 65 65 64 3b 20 74 68 65 20 72 65 61 2d 0a 20 20 20 20 20 73 6f 6e ┆ the old seed; the rea- son┆ 0x0860…0880 20 66 6f 72 20 74 68 69 73 20 69 73 20 74 68 61 74 20 74 68 65 20 61 6d 6f 75 6e 74 20 6f 66 20 ┆ for this is that the amount of ┆ 0x0880…08a0 73 74 61 74 65 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 75 73 65 64 20 69 73 0a 20 20 20 20 20 6d ┆state information used is m┆ 0x08a0…08c0 75 63 68 20 6d 6f 72 65 20 74 68 61 6e 20 61 20 73 69 6e 67 6c 65 20 77 6f 72 64 2e 20 20 28 54 ┆uch more than a single word. (T┆ 0x08c0…08e0 77 6f 20 6f 74 68 65 72 20 72 6f 75 74 69 6e 65 73 20 61 72 65 20 70 72 6f 2d 0a 20 20 20 20 20 ┆wo other routines are pro- ┆ 0x08e0…0900 76 69 64 65 64 20 74 6f 20 64 65 61 6c 20 77 69 74 68 20 72 65 73 74 61 72 74 69 6e 67 2f 63 68 ┆vided to deal with restarting/ch┆ 0x0900…0920 61 6e 67 69 6e 67 20 72 61 6e 64 6f 6d 20 6e 75 6d 62 65 72 20 67 65 6e 65 72 61 2d 0a 20 20 20 ┆anging random number genera- ┆ 0x0920…0940 20 20 74 6f 72 73 2e 29 20 20 4c 69 6b 65 20 5f 08 72 5f 08 61 5f 08 6e 5f 08 64 28 33 29 2c 20 ┆ tors.) Like _ r_ a_ n_ d(3), ┆ 0x0940…0960 68 6f 77 65 76 65 72 2c 20 5f 08 72 5f 08 61 5f 08 6e 5f 08 64 5f 08 6f 5f 08 6d 20 70 72 6f 64 ┆however, _ r_ a_ n_ d_ o_ m prod┆ 0x0960…0980 75 63 65 73 20 62 79 20 64 65 66 61 75 6c 74 20 61 0a 20 20 20 20 20 73 65 71 75 65 6e 63 65 20 ┆uces by default a sequence ┆ 0x0980…09a0 6f 66 20 6e 75 6d 62 65 72 73 20 74 68 61 74 20 63 61 6e 20 62 65 20 64 75 70 6c 69 63 61 74 65 ┆of numbers that can be duplicate┆ 0x09a0…09c0 64 20 62 79 20 63 61 6c 6c 69 6e 67 20 5f 08 73 5f 08 72 5f 08 61 5f 08 6e 5f 08 2d 0a 20 20 20 ┆d by calling _ s_ r_ a_ n_ - ┆ 0x09c0…09e0 20 20 5f 08 64 5f 08 6f 5f 08 6d 20 77 69 74 68 20 5f 08 31 20 61 73 20 74 68 65 20 73 65 65 64 ┆ _ d_ o_ m with _ 1 as the seed┆ 0x09e0…0a00 2e 0a 0a 20 20 20 20 20 54 68 65 20 5f 08 69 5f 08 6e 5f 08 69 5f 08 74 5f 08 73 5f 08 74 5f 08 ┆. The _ i_ n_ i_ t_ s_ t_ ┆ 0x0a00…0a20 61 5f 08 74 5f 08 65 20 72 6f 75 74 69 6e 65 20 61 6c 6c 6f 77 73 20 61 20 73 74 61 74 65 20 61 ┆a_ t_ e routine allows a state a┆ 0x0a20…0a40 72 72 61 79 2c 20 70 61 73 73 65 64 20 69 6e 20 61 73 20 61 6e 0a 20 20 20 20 20 61 72 67 75 6d ┆rray, passed in as an argum┆ 0x0a40…0a60 65 6e 74 2c 20 74 6f 20 62 65 20 69 6e 69 74 69 61 6c 69 7a 65 64 20 66 6f 72 20 66 75 74 75 72 ┆ent, to be initialized for futur┆ 0x0a60…0a80 65 20 75 73 65 2e 20 20 54 68 65 20 73 69 7a 65 20 6f 66 20 74 68 65 0a 20 20 20 20 20 73 74 61 ┆e use. The size of the sta┆ 0x0a80…0aa0 74 65 20 61 72 72 61 79 20 28 69 6e 20 62 79 74 65 73 29 20 69 73 20 75 73 65 64 20 62 79 20 5f ┆te array (in bytes) is used by _┆ 0x0aa0…0ac0 08 69 5f 08 6e 5f 08 69 5f 08 74 5f 08 73 5f 08 74 5f 08 61 5f 08 74 5f 08 65 20 74 6f 20 64 65 ┆ i_ n_ i_ t_ s_ t_ a_ t_ e to de┆ 0x0ac0…0ae0 63 69 64 65 20 68 6f 77 0a 20 20 20 20 20 73 6f 70 68 69 73 74 69 63 61 74 65 64 20 61 20 72 61 ┆cide how sophisticated a ra┆ 0x0ae0…0b00 6e 64 6f 6d 20 6e 75 6d 62 65 72 20 67 65 6e 65 72 61 74 6f 72 20 69 74 20 73 68 6f 75 6c 64 20 ┆ndom number generator it should ┆ 0x0b00…0b20 75 73 65 20 2d 2d 20 74 68 65 0a 20 20 20 20 20 6d 6f 72 65 20 73 74 61 74 65 2c 20 74 68 65 20 ┆use -- the more state, the ┆ 0x0b20…0b40 62 65 74 74 65 72 20 74 68 65 20 72 61 6e 64 6f 6d 20 6e 75 6d 62 65 72 73 20 77 69 6c 6c 20 62 ┆better the random numbers will b┆ 0x0b40…0b60 65 2e 20 20 28 43 75 72 72 65 6e 74 0a 20 20 20 20 20 60 60 6f 70 74 69 6d 61 6c 27 27 20 76 61 ┆e. (Current ``optimal'' va┆ 0x0b60…0b80 6c 75 65 73 20 66 6f 72 20 74 68 65 20 61 6d 6f 75 6e 74 20 6f 66 20 73 74 61 74 65 20 69 6e 66 ┆lues for the amount of state inf┆ 0x0b80…0ba0 6f 72 6d 61 74 69 6f 6e 20 61 72 65 0a 20 20 20 20 20 38 2c 20 33 32 2c 20 36 34 2c 20 31 32 38 ┆ormation are 8, 32, 64, 128┆ 0x0ba0…0bc0 2c 20 61 6e 64 20 32 35 36 20 62 79 74 65 73 3b 20 6f 74 68 65 72 20 61 6d 6f 75 6e 74 73 20 77 ┆, and 256 bytes; other amounts w┆ 0x0bc0…0be0 69 6c 6c 20 62 65 20 72 6f 75 6e 64 65 64 0a 20 20 20 20 20 64 6f 77 6e 20 74 6f 20 74 68 65 20 ┆ill be rounded down to the ┆ 0x0be0…0c00 6e 65 61 72 65 73 74 20 6b 6e 6f 77 6e 20 61 6d 6f 75 6e 74 2e 20 20 55 73 69 6e 67 20 6c 65 73 ┆nearest known amount. Using les┆ 0x0c00…0c20 73 20 74 68 61 6e 20 38 20 62 79 74 65 73 0a 20 20 20 20 20 77 69 6c 6c 20 63 61 75 73 65 20 61 ┆s than 8 bytes will cause a┆ 0x0c20…0c40 6e 20 65 72 72 6f 72 29 2e 20 20 54 68 65 20 73 65 65 64 20 66 6f 72 20 74 68 65 20 69 6e 69 74 ┆n error). The seed for the init┆ 0x0c40…0c60 69 61 6c 69 7a 61 74 69 6f 6e 0a 20 20 20 20 20 28 77 68 69 63 68 20 73 70 65 63 69 66 69 65 73 ┆ialization (which specifies┆ 0x0c60…0c80 20 61 20 73 74 61 72 74 69 6e 67 20 70 6f 69 6e 74 20 66 6f 72 20 74 68 65 20 72 61 6e 64 6f 6d ┆ a starting point for the random┆ 0x0c80…0ca0 20 6e 75 6d 62 65 72 0a 20 20 20 20 20 73 65 71 75 65 6e 63 65 2c 20 61 6e 64 20 70 72 6f 76 69 ┆ number sequence, and provi┆ 0x0ca0…0cc0 64 65 73 20 66 6f 72 20 72 65 73 74 61 72 74 69 6e 67 20 61 74 20 74 68 65 20 73 61 6d 65 20 70 ┆des for restarting at the same p┆ 0x0cc0…0ce0 6f 69 6e 74 29 20 69 73 0a 20 20 20 20 20 61 6c 73 6f 20 61 6e 20 61 72 67 75 6d 65 6e 74 2e 20 ┆oint) is also an argument. ┆ 0x0ce0…0d00 20 5f 08 69 5f 08 6e 5f 08 69 5f 08 74 5f 08 73 5f 08 74 5f 08 61 5f 08 74 5f 08 65 20 72 65 74 ┆ _ i_ n_ i_ t_ s_ t_ a_ t_ e ret┆ 0x0d00…0d20 75 72 6e 73 20 61 20 70 6f 69 6e 74 65 72 20 74 6f 20 74 68 65 20 70 72 65 76 69 2d 0a 20 20 20 ┆urns a pointer to the previ- ┆ 0x0d20…0d40 20 20 6f 75 73 20 73 74 61 74 65 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 61 72 72 61 79 2e 0a 0a ┆ ous state information array. ┆ 0x0d40…0d60 20 20 20 20 20 4f 6e 63 65 20 61 20 73 74 61 74 65 20 68 61 73 20 62 65 65 6e 20 69 6e 69 74 69 ┆ Once a state has been initi┆ 0x0d60…0d80 61 6c 69 7a 65 64 2c 20 74 68 65 20 5f 08 73 5f 08 65 5f 08 74 5f 08 73 5f 08 74 5f 08 61 5f 08 ┆alized, the _ s_ e_ t_ s_ t_ a_ ┆ 0x0d80…0da0 74 5f 08 65 20 72 6f 75 74 69 6e 65 20 70 72 6f 2d 0a 20 20 20 20 20 76 69 64 65 73 20 66 6f 72 ┆t_ e routine pro- vides for┆ 0x0da0…0dc0 20 72 61 70 69 64 20 73 77 69 74 63 68 69 6e 67 20 62 65 74 77 65 65 6e 20 73 74 61 74 65 73 2e ┆ rapid switching between states.┆ 0x0dc0…0de0 20 20 5f 08 73 5f 08 65 5f 08 74 5f 08 73 5f 08 74 5f 08 61 5f 08 74 5f 08 65 20 72 65 74 75 72 ┆ _ s_ e_ t_ s_ t_ a_ t_ e retur┆ 0x0de0…0e00 6e 73 0a 20 20 20 20 20 61 20 70 6f 69 6e 74 65 72 20 74 6f 20 74 68 65 20 70 72 65 76 69 6f 75 ┆ns a pointer to the previou┆ 0x0e00…0e20 73 20 73 74 61 74 65 20 61 72 72 61 79 3b 20 69 74 73 20 61 72 67 75 6d 65 6e 74 20 73 74 61 74 ┆s state array; its argument stat┆ 0x0e20…0e40 65 0a 20 20 20 20 20 61 72 72 61 79 20 69 73 20 75 73 65 64 20 66 6f 72 20 66 75 72 74 68 65 72 ┆e array is used for further┆ 0x0e40…0e60 20 72 61 6e 64 6f 6d 20 6e 75 6d 62 65 72 20 67 65 6e 65 72 61 74 69 6f 6e 20 75 6e 74 69 6c 20 ┆ random number generation until ┆ 0x0e60…0e80 74 68 65 0a 0a 0a 0a 0a 0a 0a 20 20 20 20 20 6e 65 78 74 20 63 61 6c 6c 20 74 6f 20 5f 08 69 5f ┆the next call to _ i_┆ 0x0e80…0ea0 08 6e 5f 08 69 5f 08 74 5f 08 73 5f 08 74 5f 08 61 5f 08 74 5f 08 65 20 6f 72 20 5f 08 73 5f 08 ┆ n_ i_ t_ s_ t_ a_ t_ e or _ s_ ┆ 0x0ea0…0ec0 65 5f 08 74 5f 08 73 5f 08 74 5f 08 61 5f 08 74 5f 08 65 2e 0a 0a 20 20 20 20 20 4f 6e 63 65 20 ┆e_ t_ s_ t_ a_ t_ e. Once ┆ 0x0ec0…0ee0 61 20 73 74 61 74 65 20 61 72 72 61 79 20 68 61 73 20 62 65 65 6e 20 69 6e 69 74 69 61 6c 69 7a ┆a state array has been initializ┆ 0x0ee0…0f00 65 64 2c 20 69 74 20 6d 61 79 20 62 65 20 72 65 73 74 61 72 74 65 64 0a 20 20 20 20 20 61 74 20 ┆ed, it may be restarted at ┆ 0x0f00…0f20 61 20 64 69 66 66 65 72 65 6e 74 20 70 6f 69 6e 74 20 65 69 74 68 65 72 20 62 79 20 63 61 6c 6c ┆a different point either by call┆ 0x0f20…0f40 69 6e 67 20 5f 08 69 5f 08 6e 5f 08 69 5f 08 74 5f 08 73 5f 08 74 5f 08 61 5f 08 74 5f 08 65 20 ┆ing _ i_ n_ i_ t_ s_ t_ a_ t_ e ┆ 0x0f40…0f60 28 77 69 74 68 20 74 68 65 0a 20 20 20 20 20 64 65 73 69 72 65 64 20 73 65 65 64 2c 20 74 68 65 ┆(with the desired seed, the┆ 0x0f60…0f80 20 73 74 61 74 65 20 61 72 72 61 79 2c 20 61 6e 64 20 69 74 73 20 73 69 7a 65 29 20 6f 72 20 62 ┆ state array, and its size) or b┆ 0x0f80…0fa0 79 20 63 61 6c 6c 69 6e 67 0a 20 20 20 20 20 62 6f 74 68 20 5f 08 73 5f 08 65 5f 08 74 5f 08 73 ┆y calling both _ s_ e_ t_ s┆ 0x0fa0…0fc0 5f 08 74 5f 08 61 5f 08 74 5f 08 65 20 28 77 69 74 68 20 74 68 65 20 73 74 61 74 65 20 61 72 72 ┆_ t_ a_ t_ e (with the state arr┆ 0x0fc0…0fe0 61 79 29 20 61 6e 64 20 5f 08 73 5f 08 72 5f 08 61 5f 08 6e 5f 08 64 5f 08 6f 5f 08 6d 20 28 77 ┆ay) and _ s_ r_ a_ n_ d_ o_ m (w┆ 0x0fe0…1000 69 74 68 20 74 68 65 0a 20 20 20 20 20 64 65 73 69 72 65 64 20 73 65 65 64 29 2e 20 20 54 68 65 ┆ith the desired seed). The┆ 0x1000…1020 20 61 64 76 61 6e 74 61 67 65 20 6f 66 20 63 61 6c 6c 69 6e 67 20 62 6f 74 68 20 5f 08 73 5f 08 ┆ advantage of calling both _ s_ ┆ 0x1020…1040 65 5f 08 74 5f 08 73 5f 08 74 5f 08 61 5f 08 74 5f 08 65 20 61 6e 64 0a 20 20 20 20 20 5f 08 73 ┆e_ t_ s_ t_ a_ t_ e and _ s┆ 0x1040…1060 5f 08 72 5f 08 61 5f 08 6e 5f 08 64 5f 08 6f 5f 08 6d 20 69 73 20 74 68 61 74 20 74 68 65 20 73 ┆_ r_ a_ n_ d_ o_ m is that the s┆ 0x1060…1080 69 7a 65 20 6f 66 20 74 68 65 20 73 74 61 74 65 20 61 72 72 61 79 20 64 6f 65 73 20 6e 6f 74 20 ┆ize of the state array does not ┆ 0x1080…10a0 68 61 76 65 20 74 6f 0a 20 20 20 20 20 62 65 20 72 65 6d 65 6d 62 65 72 65 64 20 61 66 74 65 72 ┆have to be remembered after┆ 0x10a0…10c0 20 69 74 20 69 73 20 69 6e 69 74 69 61 6c 69 7a 65 64 2e 0a 0a 20 20 20 20 20 57 69 74 68 20 32 ┆ it is initialized. With 2┆ 0x10c0…10e0 35 36 20 62 79 74 65 73 20 6f 66 20 73 74 61 74 65 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 2c 20 74 ┆56 bytes of state information, t┆ 0x10e0…1100 68 65 20 70 65 72 69 6f 64 20 6f 66 20 74 68 65 20 72 61 6e 2d 0a 20 20 20 20 20 64 6f 6d 20 6e ┆he period of the ran- dom n┆ 0x1100…1120 75 6d 62 65 72 20 67 65 6e 65 72 61 74 6f 72 20 69 73 20 67 72 65 61 74 65 72 20 74 68 61 6e 20 ┆umber generator is greater than ┆ 0x1120…1140 32 36 39 2c 20 77 68 69 63 68 20 73 68 6f 75 6c 64 20 62 65 0a 20 20 20 20 20 73 75 66 66 69 63 ┆269, which should be suffic┆ 0x1140…1160 69 65 6e 74 20 66 6f 72 20 6d 6f 73 74 20 70 75 72 70 6f 73 65 73 2e 0a 0a 44 08 44 08 44 08 44 ┆ient for most purposes. D D D D┆ 0x1160…1180 49 08 49 08 49 08 49 41 08 41 08 41 08 41 47 08 47 08 47 08 47 4e 08 4e 08 4e 08 4e 4f 08 4f 08 ┆I I I IA A A AG G G GN N N NO O ┆ 0x1180…11a0 4f 08 4f 53 08 53 08 53 08 53 54 08 54 08 54 08 54 49 08 49 08 49 08 49 43 08 43 08 43 08 43 53 ┆O OS S S ST T T TI I I IC C C CS┆ 0x11a0…11c0 08 53 08 53 08 53 0a 20 20 20 20 20 49 66 20 5f 08 69 5f 08 6e 5f 08 69 5f 08 74 5f 08 73 5f 08 ┆ S S S If _ i_ n_ i_ t_ s_ ┆ 0x11c0…11e0 74 5f 08 61 5f 08 74 5f 08 65 20 69 73 20 63 61 6c 6c 65 64 20 77 69 74 68 20 6c 65 73 73 20 74 ┆t_ a_ t_ e is called with less t┆ 0x11e0…1200 68 61 6e 20 38 20 62 79 74 65 73 20 6f 66 20 73 74 61 74 65 0a 20 20 20 20 20 69 6e 66 6f 72 6d ┆han 8 bytes of state inform┆ 0x1200…1220 61 74 69 6f 6e 2c 20 6f 72 20 69 66 20 5f 08 73 5f 08 65 5f 08 74 5f 08 73 5f 08 74 5f 08 61 5f ┆ation, or if _ s_ e_ t_ s_ t_ a_┆ 0x1220…1240 08 74 5f 08 65 20 64 65 74 65 63 74 73 20 74 68 61 74 20 74 68 65 20 73 74 61 74 65 20 69 6e 66 ┆ t_ e detects that the state inf┆ 0x1240…1260 6f 72 6d 61 2d 0a 20 20 20 20 20 74 69 6f 6e 20 68 61 73 20 62 65 65 6e 20 67 61 72 62 6c 65 64 ┆orma- tion has been garbled┆ 0x1260…1280 2c 20 65 72 72 6f 72 20 6d 65 73 73 61 67 65 73 20 61 72 65 20 70 72 69 6e 74 65 64 20 6f 6e 20 ┆, error messages are printed on ┆ 0x1280…12a0 74 68 65 0a 20 20 20 20 20 73 74 61 6e 64 61 72 64 20 65 72 72 6f 72 20 6f 75 74 70 75 74 2e 0a ┆the standard error output. ┆ 0x12a0…12c0 0a 53 08 53 08 53 08 53 45 08 45 08 45 08 45 45 08 45 08 45 08 45 20 41 08 41 08 41 08 41 4c 08 ┆ S S S SE E E EE E E E A A A AL ┆ 0x12c0…12e0 4c 08 4c 08 4c 53 08 53 08 53 08 53 4f 08 4f 08 4f 08 4f 0a 20 20 20 20 20 4c 69 62 72 61 72 79 ┆L L LS S S SO O O O Library┆ 0x12e0…1300 20 46 75 6e 63 74 69 6f 6e 73 20 28 33 29 3a 20 20 72 61 6e 64 0a 0a 4c 08 4c 08 4c 08 4c 49 08 ┆ Functions (3): rand L L L LI ┆ 0x1300…1320 49 08 49 08 49 4d 08 4d 08 4d 08 4d 49 08 49 08 49 08 49 54 08 54 08 54 08 54 41 08 41 08 41 08 ┆I I IM M M MI I I IT T T TA A A ┆ 0x1320…1340 41 54 08 54 08 54 08 54 49 08 49 08 49 08 49 4f 08 4f 08 4f 08 4f 4e 08 4e 08 4e 08 4e 53 08 53 ┆AT T T TI I I IO O O ON N N NS S┆ 0x1340…1360 08 53 08 53 0a 20 20 20 20 20 41 62 6f 75 74 20 32 2f 33 20 74 68 65 20 73 70 65 65 64 20 6f 66 ┆ S S About 2/3 the speed of┆ 0x1360…1380 20 5f 08 72 5f 08 61 5f 08 6e 5f 08 64 28 33 43 29 2e 0a 0a 4d 61 72 63 68 20 31 39 38 39 20 20 ┆ _ r_ a_ n_ d(3C). March 1989 ┆ 0x1380…13a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 54 58 20 50 ┆ TX P┆ 0x13a0…13c0 72 6f 67 72 61 6d 6d 65 72 27 73 20 52 65 66 65 72 65 6e 63 65 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a ┆rogrammer's Reference ┆ 0x13c0…13d7 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a ┆ ┆