From 71200f30920bdfe8fd46f2fd2f82e9f81a72ccc6 Mon Sep 17 00:00:00 2001 From: aegkmq <140575296+aegkmq@users.noreply.github.com> Date: Fri, 28 Jul 2023 00:35:59 +0900 Subject: [PATCH] Fix random_f32 --- run.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run.c b/run.c index e7eb0e0..b7a534e 100644 --- a/run.c +++ b/run.c @@ -345,7 +345,7 @@ unsigned int random_u32() { return (rng_seed * 0x2545F4914F6CDD1Dull) >> 32; } float random_f32() { - return (random_u32() >> 9) * (1.0f / 8388608.0f); + return (random_u32() >> 8) / 16777216.0f; } int sample(float* probabilities, int n) { // sample index from probabilities, they must sum to 1