rand.c

Go to the documentation of this file.
00001 
00040 /* This would really belong to libc */
00041 static int rand(void)
00042 {
00043     static unsigned long seed;
00044 
00045     /* Randomize seed */
00046     seed = (seed ^ 0x4BAD5A39UL) + 6513973UL;
00047 
00048     return (int)(seed>>16);
00049 }