rand X srand X
1: /* @(#)rand.c 2.1 SCCS id keyword */ 2: static long randx = 1; 3: 4: srand(x) 5: unsigned x; 6: { 7: randx = x; 8: } 9: 10: rand() 11: { 12: return(((randx = randx*1103515245 + 12345)>>16) & 077777); 13: }