home *** CD-ROM | disk | FTP | other *** search
- /* randi1 - pseudo-random integer routine */
- /*
- McCracken, Daniel D. "A Guide to PL/M Programming for
- Microcomputer Applications", Addison-Wesley, Reading, Mass.,
- 1978, p. 113.
-
- This routine generates a full cycle of unsigned 16-bit
- pseudo-random numbers using the multiplicative congruential method.
- It assumes that type unsigned is implemented as 16 bit binary numbers.
-
- Converted to C by
-
- William G. Hutchison, Jr.
- P.O. Box 278
- Exton, PA 19341-0278
- U.S.A.
-
- CompuServe 70665,1307
- Englewood, CO CNODE #1080
-
- */
-
- randi1(p) /* 16 bit random integer */
- unsigned *p /* previous value */;
- {
- return (*p= 2053 * *p + 13849);
- } /* end of randi1 */