aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Blechmann <timblech@users.sourceforge.net>2006-08-10 21:23:33 +0000
committerIOhannes m zmölnig <zmoelnig@iem.at>2015-10-14 15:12:02 +0200
commit47603a7ffe9d354ef5a2af7981504527a9e742da (patch)
tree8a10632ac311b5465ad3d92fb5debf0a6417f843
parent2c157bd8aa1f5387169cc0c0910d36c8068c4068 (diff)
max/msp fix (thanks to thomas for mentioning this)
svn path=/trunk/externals/tb/; revision=5551
-rw-r--r--chaos/src/chaos.hpp21
1 files 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 <cstdlib>
+#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);
}