On 07/09/11 15:23, Mathieu Bouchard wrote:
On Tue, 6 Sep 2011, ronni montoya wrote:
Do anybody have an idea why is this behaivor and how to solve it?
nan is often due to trying to do 0/0 or log(-1) or other out-of-range things.
Probably inf - inf or 0 * inf are NaN, I haven't checked the specs.
(some other out-of-range operations yield +inf or -inf instead, it depends)
Actually... is [clip~ -1 1] really able to get rid of nan ?
No, because NaN compares always result in false:
http://pure-data.git.sourceforge.net/git/gitweb.cgi?p=pure-data/pure-data;a=...
Workaround/fix might be:
if (!(f > x->lo)) f = x->lo; if (!(f < x->hi)) f = x->hi;
But this might all be screwed up depending on how Pd and/or freeverb is compiled, I know some inf/nan things can behave even more strangely with -ffast-math (for example, Pd .git has no mention of it as far as I can tell).
Claude