summaryrefslogtreecommitdiff
path: root/mix.c
diff options
context:
space:
mode:
authorJSDurand <mmemmew@gmail.com>2021-07-12 12:07:30 +0800
committerJSDurand <mmemmew@gmail.com>2021-07-12 12:07:30 +0800
commitd073f301aa94cd7a8278681d8d723d74fa5d5d3f (patch)
treeafb67e8393307c5bec32ac7f8444854a8b3e6cd0 /mix.c
parent75a875116f7060e5a0512b447123253d3c25946a (diff)
Use double instead of float
I thought that a float has more precision than a double. Silly me.
Diffstat (limited to 'mix.c')
-rw-r--r--mix.c5
1 files changed, 2 insertions, 3 deletions
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;
}
-