alpinestudios / oogabooga

ooga booga
Other
223 stars 247 forks source link

Issues with get_random_int_in_range() #19

Closed DakotaRichardson closed 3 months ago

DakotaRichardson commented 3 months ago

While trying to select a random value between (0,3) I noticed the function only returned 0 and 2 never 1. I overcame this issue by casting the get_random_float64_in_range() function to an integer.

asbott commented 3 months ago

Can you submit a small repro of this? I am not having the same issue if I do this:

for (u64 i = 0; i < 69; i++) {
    log("%d", get_random_int_in_range(0, 3));
}
asbott commented 3 months ago

Closing this for now due to inactivity, let me know if you are able to make a small repro