long strtol(const char *nptr, char **endptr, int base);
float atof(const char *s);
+#define RAND_MAX 2147483647
+
unsigned int rand(void);
+void srand(unsigned int seed);
void abort(void);
#endif /* __STDLIB_H */
* rand - Returns a pseudo random number
*/
-static unsigned int seed;
+static unsigned int randseed;
unsigned int rand(void)
{
- seed = 129 * seed + 907633385;
- return seed;
+ randseed = 129 * randseed + 907633385;
+ return randseed;
+}
+
+void srand(unsigned int seed)
+{
+ randseed = seed;
}
void abort(void)