random in range func
This commit is contained in:
parent
8d081c1afe
commit
9ebd7fa7eb
1 changed files with 4 additions and 0 deletions
|
@ -15,3 +15,7 @@ u64 get_random() {
|
||||||
f32 get_random_float32() {
|
f32 get_random_float32() {
|
||||||
return (float32)get_random()/(float32)UINT64_MAX;
|
return (float32)get_random()/(float32)UINT64_MAX;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
f32 get_random_float32_in_range(f32 min, f32 max) {
|
||||||
|
return min + (max-min) * get_random_float32();
|
||||||
|
}
|
Reference in a new issue