From af6a9c5552d3bd4e708d644cc47e4be4ca2edaf8 Mon Sep 17 00:00:00 2001 From: pommicket Date: Fri, 28 Oct 2022 13:28:18 -0400 Subject: fixed rust '\\' highlighting, among other things --- math.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'math.c') diff --git a/math.c b/math.c index d1f30dc..c7ac64b 100644 --- a/math.c +++ b/math.c @@ -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); } -- cgit v1.2.3