From 47603a7ffe9d354ef5a2af7981504527a9e742da Mon Sep 17 00:00:00 2001 From: Tim Blechmann Date: Thu, 10 Aug 2006 21:23:33 +0000 Subject: max/msp fix (thanks to thomas for mentioning this) svn path=/trunk/externals/tb/; revision=5551 --- chaos/src/chaos.hpp | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/chaos/src/chaos.hpp b/chaos/src/chaos.hpp index bb9971d..971d503 100644 --- a/chaos/src/chaos.hpp +++ b/chaos/src/chaos.hpp @@ -1,18 +1,18 @@ -// -// +// +// // chaos~ // Copyright (C) 2004 Tim Blechmann -// +// // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; see the file COPYING. If not, write to // the Free Software Foundation, Inc., 59 Temple Place - Suite 330, @@ -30,6 +30,11 @@ #include +#if FLEXT_SYS != FLEXT_SYS_PD +#define PD_BIGORSMALL(f) ((((*(unsigned int*)&(f))&0x60000000)==0) || \ + (((*(unsigned int*)&(f))&0x60000000)==0x60000000)) +#endif + /* internal we can work with a higher precision than pd */ #ifdef DOUBLE_PRECISION typedef double data_t; @@ -42,15 +47,15 @@ typedef float data_t; inline data_t chaos_mod(data_t x, data_t y) { #ifdef DOUBLE_PRECISION - return fmod(x,y); + return fmod(x,y); #else - return fmodf(x,y); + return fmodf(x,y); #endif } inline data_t rand_range(data_t low, data_t high) { - return low + ( (rand() * (high - low)) / RAND_MAX); + return low + ( (rand() * (high - low)) / RAND_MAX); } -- cgit v1.2.1