Fix random_f32

This commit is contained in:
aegkmq
2023-07-28 00:35:59 +09:00
parent 1bdf5af743
commit 71200f3092
+1 -1
View File
@@ -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