Files
osc2025/kernel/lib/random.c
2025-04-08 06:59:50 +08:00

13 lines
224 B
C

#include <random.h>
const int _random_a = 100003;
const int _random_c = 114514 + 33;
const int _random_m = 1000000007;
int seed = 0;
int random(void)
{
seed = _random_a * (seed + _random_c) % _random_m;
return seed;
}