diff options
author | JSDurand <mmemmew@gmail.com> | 2021-07-12 12:07:30 +0800 |
---|---|---|
committer | JSDurand <mmemmew@gmail.com> | 2021-07-12 12:07:30 +0800 |
commit | d073f301aa94cd7a8278681d8d723d74fa5d5d3f (patch) | |
tree | afb67e8393307c5bec32ac7f8444854a8b3e6cd0 /util.h | |
parent | 75a875116f7060e5a0512b447123253d3c25946a (diff) |
Use double instead of float
I thought that a float has more precision than a double. Silly me.
Diffstat (limited to 'util.h')
-rw-r--r-- | util.h | 24 |
1 files changed, 13 insertions, 11 deletions
@@ -29,10 +29,11 @@ } /* An empty node. */ -#define EMPTY_NODE (Node_t) { (Node_v) { .f=0 }, NULL } +#define EMPTY_NODE (Node_t) { (Node_v) { .n=0 }, NULL } typedef union { - float f; + /* the typedef for NUMT is below, so I cannot use that alias. */ + double n; void *v; /* very evil */ } Node_v; @@ -88,16 +89,17 @@ typedef struct Node { /* types */ -typedef float Volume; -typedef float Samples; -typedef float Hertz; -typedef float Seconds; -typedef float Pulse; -typedef float Beats; -typedef float Semitones; -typedef Pulse *Wave; - typedef unsigned long LENT; +typedef double NUMT; + +typedef NUMT Volume; +typedef NUMT Samples; +typedef NUMT Hertz; +typedef NUMT Seconds; +typedef NUMT Pulse; +typedef NUMT Beats; +typedef NUMT Semitones; +typedef Pulse *Wave; typedef struct { Wave w; |