CoolPotOS/util/rand.c

12 lines
222 B
C
Raw Normal View History

2024-05-12 14:34:03 +08:00
#include "../include/common.h"
static unsigned long next1 = 1;
unsigned int rand(void) {
next1 = next1 * 1103515245 + 12345;
return ((unsigned int)(next1));
}
void srand(unsigned long seed) {
next1 = seed;
}