home *** CD-ROM | disk | FTP | other *** search
- /* rand.c - Eric Giguere - Transactor v2.6 */
-
- static unsigned long next;
-
- void srand(seed)
- unsigned long seed;
- {
- next = seed;
- }
-
- #define A 1664525L
- #define B 65536L
-
- unsigned long rand(max)
- unsigned long max;
- {
- next = A * next + 1L;
-
- return (((next / B) * max) / B);
- }
-