From 4f1ee28d687d583601d41ff58e1618b381d2675f Mon Sep 17 00:00:00 2001 From: Katja Date: Sun, 6 Nov 2011 14:41:44 +0000 Subject: made creb compliant with double precision - changed float to t_float - adapted subnormal detection svn path=/trunk/externals/creb/; revision=15706 --- modules/diag~.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'modules/diag~.c') diff --git a/modules/diag~.c b/modules/diag~.c index c8a94c5..1e99682 100644 --- a/modules/diag~.c +++ b/modules/diag~.c @@ -43,8 +43,8 @@ typedef struct diag } t_diag; -static float randfloat(void){ - float r = rand (); +static t_float randfloat(void){ + t_float r = rand (); r /= (RAND_MAX/2); r -= 1; return r; @@ -62,15 +62,15 @@ static void diag_eigen(t_diag *x, t_floatarg index, t_floatarg val) /* set decay time of pole at index */ static void diag_time(t_diag *x, t_floatarg index, t_floatarg time) { - float r; + t_float r; /* time in ms */ time *= 0.001; - if (time < 0.0f) time = 0.0f; - r = pow(0.001f, (t_float)x->x_ctl.c_order / (time * sys_getsr())); - if (r < 0.0f) r = 0.0f; - if (r > 1.0f) r = 1.0f; + if (time < 0.0) time = 0.0; + r = pow(0.001, (t_float)x->x_ctl.c_order / (time * sys_getsr())); + if (r < 0.0) r = 0.0; + if (r > 1.0) r = 1.0; diag_eigen(x, index, r); } -- cgit v1.2.1