diff options
author | pommicket <pommicket@gmail.com> | 2022-10-28 13:28:18 -0400 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2022-10-28 13:28:18 -0400 |
commit | af6a9c5552d3bd4e708d644cc47e4be4ca2edaf8 (patch) | |
tree | 700fa3006babc185018b9ac49cdec90dbce50cb9 /math.c | |
parent | 67beb21c710509acdb11017a77805ec57676e666 (diff) |
fixed rust '\\' highlighting, among other things
Diffstat (limited to 'math.c')
-rw-r--r-- | math.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -176,7 +176,10 @@ static inline float randf(void) { static float rand_gauss(void) { // https://en.wikipedia.org/wiki/Normal_distribution#Generating_values_from_normal_distribution - float U = randf(), V = randf(); + float U, V; + do + U = randf(), V = randf(); + while (U == 0 || V == 0); return sqrtf(-2 * logf(U)) * cosf(TAUf * V); } |