summaryrefslogtreecommitdiff
path: root/util.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 /util.c
parent75a875116f7060e5a0512b447123253d3c25946a (diff)
Use double instead of float
I thought that a float has more precision than a double. Silly me.
Diffstat (limited to 'util.c')
-rw-r--r--util.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/util.c b/util.c
index c5921e5..c998930 100644
--- a/util.c
+++ b/util.c
@@ -52,7 +52,7 @@ mix_waves(WaveFrag *frags, LENT len)
LENT max_len = 0;
- Pulse p = 0.0f;
+ Pulse p = 0.0;
for (LENT i = 0; i < len; i++)
max_len = max(max_len, (frags+i)->n);
@@ -61,7 +61,7 @@ mix_waves(WaveFrag *frags, LENT len)
wf.w = MYALLOC(Pulse, max_len);
for (LENT i = 0; i < max_len; i++) {
- p = 0.0f;
+ p = 0.0;
for (LENT j = 0; j < len; j++)
if (i < (frags+j)->n) p += *((frags+j)->w+i);