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. --- util.h | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'util.h') diff --git a/util.h b/util.h index 700a8bf..3665ee1 100644 --- a/util.h +++ b/util.h @@ -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; -- cgit v1.2.3-18-g5258