From dff74800d391a08e024cabb8ec13f96223a44601 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 18 Jun 2003 13:53:18 +0000 Subject: if a prime is detected, "1" is send, else "0" (no more bangs) svn path=/trunk/externals/zexy/; revision=706 --- src/z_prime.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/z_prime.c b/src/z_prime.c index 5e4a9d0..6d0f100 100644 --- a/src/z_prime.c +++ b/src/z_prime.c @@ -16,19 +16,25 @@ void prime_float(t_prime *x, t_float f) unsigned int max_divisor; unsigned int divisor=1; - if (f<2)return; + if (f<2){ + outlet_float(x->x_obj.ob_outlet, 0.0); + return; + } if (!(i%2)){ - if (i==2)outlet_bang(x->x_obj.ob_outlet); + outlet_float(x->x_obj.ob_outlet, (t_float)(i==2)); return; } max_divisor = sqrt(f)+1; while ((divisor+=2)x_obj.ob_outlet, 0.0); + return; + } - outlet_bang(x->x_obj.ob_outlet); + outlet_float(x->x_obj.ob_outlet, 1.0); } void *prime_new(void) -- cgit v1.2.1