home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / misc / emu / AROSdev.lha / AROS / compiler / alib / fastrand.c < prev    next >
Encoding:
C/C++ Source or Header  |  1997-01-27  |  657 b   |  48 lines

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: fastrand.c,v 1.2 1997/01/27 00:16:36 ldp Exp $
  4.  
  5.     Desc:
  6.     Lang: english
  7. */
  8.  
  9. /*****************************************************************************
  10.  
  11.     NAME */
  12. #include <proto/alib.h>
  13.  
  14.     ULONG FastRand (
  15.  
  16. /*  SYNOPSIS */
  17.     ULONG seed)
  18.  
  19. /*  FUNCTION
  20.  
  21.     INPUTS
  22.  
  23.     RESULT
  24.  
  25.     NOTES
  26.  
  27.     EXAMPLE
  28.  
  29.     BUGS
  30.  
  31.     SEE ALSO
  32.  
  33.     INTERNALS
  34.  
  35.     HISTORY
  36.     06.12.96 digulla Created after original from libnix
  37.  
  38. ******************************************************************************/
  39. {
  40.     ULONG a = seed << 1;
  41.  
  42.     if ((LONG)seed <= 0)
  43.     a ^= 0x1d872b41;
  44.  
  45.     return a;
  46. } /* FastRand */
  47.  
  48.