From 89aa8fc22857d7da0e6302e4c17d02eae761e54b Mon Sep 17 00:00:00 2001 From: pranaygupta36 <pranayguptastudent@gmail.com> Date: Sat, 5 May 2018 22:18:42 +0530 Subject: [PATCH] support for double precision added, errmsg on wild precision values --- pd/src/m_pd.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pd/src/m_pd.h b/pd/src/m_pd.h index 209dbcafb..8dab0a9f0 100644 --- a/pd/src/m_pd.h +++ b/pd/src/m_pd.h @@ -89,9 +89,19 @@ typedef unsigned __int64 uint64_t; #if !defined(PD_LONGINTTYPE) #define PD_LONGINTTYPE long #endif -#if !defined(PD_FLOATTYPE) + +#if !defined(PD_FLOAT_PRECISION) +#define PD_FLOAT_PRECISION 32 /* 32 for single precision or 64 for double precision */ +#endif + +#if PD_FLOAT_PRECISION == 32 #define PD_FLOATTYPE float +#elif PD_FLOAT_PRECISION == 64 +#define PD_FLOATTYPE double +#else +#error invalid PD_FLOATPRECISION: must be 32 or 64 #endif + typedef PD_LONGINTTYPE t_int; /* pointer-size integer */ typedef PD_FLOATTYPE t_float; /* a float type at most the same size */ typedef PD_FLOATTYPE t_floatarg; /* float type for function calls */ -- GitLab