From efaa0eead75e0b886d41a9ec9db69482fd834295 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Fri, 13 Nov 2020 23:05:00 +0100 Subject: Improved random generator --- libc/random.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libc/random.c b/libc/random.c index 086fa11..89fe2be 100644 --- a/libc/random.c +++ b/libc/random.c @@ -13,7 +13,7 @@ void srand(u32 seed) u32 rand() { - g_seed = (214013 * g_seed + 2531011); + g_seed = g_seed * 1103515245 + 12345; return (g_seed >> 16) & 0x7FFF; } -- cgit v1.2.3