home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / OSK / LIB / unix.zoo / rand.c < prev    next >
Text File  |  2009-11-06  |  272b  |  15 lines

  1. static long seed = 1L;
  2.  
  3. int rand()
  4.           {
  5.           seed = (1103515245L * seed + 12345) & 0x7FFFFFFF;
  6.           return((int) (seed & 077777));
  7.           }
  8.  
  9. int srand (new_seed)
  10.           long new_seed;
  11.           {
  12.           seed = new_seed & 0x7FFFFFFF;
  13.           }
  14.  
  15.