<p dir="ltr">Yep.  It&#39;s damaging to have NaN&#39;s propagating around in Pd. [pow] having a single output means that you only want real values.  The result is not a real number-I think the result should just be set to 0 (perhaps 1 depending on what the worst usage case is).  Would it be better to have pow just output the real part of the complex number, generated from:</p>

<p dir="ltr">(-1*base)^exp*e^(pi*exp*i)<br>
Which is (-1*base)^exp*cos(pi*exp)<br>
when base is a negative number </p>
<p dir="ltr">this assumes the standard branch cut in complex analysis:<br>
-1=e^(pi*i) and not e^(3*pi*i) or any other</p>
<p dir="ltr">Chuck<br></p>
<div class="gmail_quote">On Apr 23, 2013 9:11 PM, &quot;Ivica Ico Bukvic&quot; &lt;<a href="mailto:ico@vt.edu">ico@vt.edu</a>&gt; wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
It may be a bit more complex since exponent values between -1 and 1 are the<br>
ones that generate imaginary numbers from negative values, with the<br>
exception of 0 which generates 1. Latest pd-l2ork patch tries to fix this.<br>
See:<br>
<br>
<a href="https://github.com/pd-l2ork/pd/commit/95d82d33d2580a00e32d725e0f5147d88cdaf3" target="_blank">https://github.com/pd-l2ork/pd/commit/95d82d33d2580a00e32d725e0f5147d88cdaf3</a><br>
70<br>
<br>
&gt; -----Original Message-----<br>
&gt; From: <a href="mailto:pd-list-bounces@iem.at">pd-list-bounces@iem.at</a> [mailto:<a href="mailto:pd-list-bounces@iem.at">pd-list-bounces@iem.at</a>] On Behalf Of<br>
&gt; IOhannes m zmoelnig<br>
&gt; Sent: Tuesday, April 23, 2013 6:21 AM<br>
&gt; To: <a href="mailto:pd-list@iem.at">pd-list@iem.at</a><br>
&gt; Subject: Re: [PD] Negative input numbers for [pow] return 0<br>
&gt;<br>
&gt; -----BEGIN PGP SIGNED MESSAGE-----<br>
&gt; Hash: SHA1<br>
&gt;<br>
&gt; On 2013-04-23 11:50, Joe White wrote:<br>
&gt; &gt; Out of curiosity, are the workarounds suggested more of a result of<br>
&gt; &gt; the difficulty of extending the Pd core rather than the<br>
&gt; &gt; implications that such a change might have?<br>
&gt;<br>
&gt; the implementation would be trivial (merely removing the safeguards<br>
&gt; that currently clamp the value to 0)<br>
&gt;<br>
&gt; fgmasdr<br>
&gt; IOhannes<br>
&gt;<br>
&gt; -----BEGIN PGP SIGNATURE-----<br>
&gt; Version: GnuPG v1.4.12 (GNU/Linux)<br>
&gt; Comment: Using GnuPG with Mozilla - <a href="http://enigmail.mozdev.org/" target="_blank">http://enigmail.mozdev.org/</a><br>
&gt;<br>
&gt; iEYEARECAAYFAlF2YIEACgkQkX2Xpv6ydvQyoQCgiC95SRoOKaOHu6qkmpX+kD8<br>
&gt; 0<br>
&gt; /ugAoJymAbmtt6qWkZM5rAlObyhdarRF<br>
&gt; =KUIu<br>
&gt; -----END PGP SIGNATURE-----<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; <a href="mailto:Pd-list@iem.at">Pd-list@iem.at</a> mailing list<br>
&gt; UNSUBSCRIBE and account-management -&gt;<br>
&gt; <a href="http://lists.puredata.info/listinfo/pd-list" target="_blank">http://lists.puredata.info/listinfo/pd-list</a><br>
<br>
<br>
_______________________________________________<br>
<a href="mailto:Pd-list@iem.at">Pd-list@iem.at</a> mailing list<br>
UNSUBSCRIBE and account-management -&gt; <a href="http://lists.puredata.info/listinfo/pd-list" target="_blank">http://lists.puredata.info/listinfo/pd-list</a><br>
</blockquote></div>