mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 15:18:49 +00:00
Add sanity conversion for rand.norm_float64
This commit is contained in:
@@ -116,6 +116,12 @@ norm_float64 :: proc(r: ^Rand = nil) -> f64 {
|
|||||||
0.008624485, 0.005548995, 0.0026696292,
|
0.008624485, 0.005548995, 0.0026696292,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
r := r;
|
||||||
|
if r == nil {
|
||||||
|
// NOTE(bill, 2020-09-07): Do this so that people can
|
||||||
|
// enforce the global random state if necessary with `nil`
|
||||||
|
r = &global_rand;
|
||||||
|
}
|
||||||
|
|
||||||
for {
|
for {
|
||||||
j := i32(uint32(r));
|
j := i32(uint32(r));
|
||||||
|
|||||||
Reference in New Issue
Block a user