From d073f301aa94cd7a8278681d8d723d74fa5d5d3f Mon Sep 17 00:00:00 2001 From: JSDurand Date: Mon, 12 Jul 2021 12:07:30 +0800 Subject: Use double instead of float I thought that a float has more precision than a double. Silly me. --- mix.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'mix.c') diff --git a/mix.c b/mix.c index ae1c1ab..987993a 100644 --- a/mix.c +++ b/mix.c @@ -10,13 +10,12 @@ U_ATTR Pulse mix_sound(Wave w, LENT n) { - Pulse result = 0.0f;; + Pulse result = 0.0; for (LENT i = 0; i < n;) result += *(w+i++); - result /= (float) n; + result /= (NUMT) n; return result; } - -- cgit v1.2.3-18-g5258