Re: [PD] Negative input numbers for [pow] return 0

2013-04-24 Thread IOhannes m zmoelnig
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 2013-04-24 04:10, Ivica Ico Bukvic wrote: It may be a bit more complex since exponent values between -1 and 1 are the ones that generate imaginary numbers from negative values, we call those NaNs. the implementation would be trivial implied if

Re: [PD] Negative input numbers for [pow] return 0

2013-04-24 Thread Joe White
It may be a bit more complex since exponent values between -1 and 1 are the ones that generate imaginary numbers from negative values, with the exception of 0 which generates 1. Latest pd-l2ork patch tries to fix this. See:

Re: [PD] Negative input numbers for [pow] return 0

2013-04-23 Thread Joe White
Disclaimer: I don't feel too strongly about this because I realised my original calculation was wrong anyway, however... If you think about it negative exponents require a completely different algorithm that is discontinuous with the one for positives. Instead of multiplying you divide n times.

Re: [PD] Negative input numbers for [pow] return 0

2013-04-23 Thread IOhannes m zmoelnig
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 2013-04-23 11:50, Joe White wrote: Out of curiosity, are the workarounds suggested more of a result of the difficulty of extending the Pd core rather than the implications that such a change might have? the implementation would be trivial

Re: [PD] Negative input numbers for [pow] return 0

2013-04-23 Thread Ivica Ico Bukvic
/95d82d33d2580a00e32d725e0f5147d88cdaf3 70 -Original Message- From: pd-list-boun...@iem.at [mailto:pd-list-boun...@iem.at] On Behalf Of IOhannes m zmoelnig Sent: Tuesday, April 23, 2013 6:21 AM To: pd-list@iem.at Subject: Re: [PD] Negative input numbers for [pow] return 0 -BEGIN PGP SIGNED MESSAGE- Hash

Re: [PD] Negative input numbers for [pow] return 0

2013-04-23 Thread Charles Z Henry
/95d82d33d2580a00e32d725e0f5147d88cdaf3 70 -Original Message- From: pd-list-boun...@iem.at [mailto:pd-list-boun...@iem.at] On Behalf Of IOhannes m zmoelnig Sent: Tuesday, April 23, 2013 6:21 AM To: pd-list@iem.at Subject: Re: [PD] Negative input numbers for [pow] return 0

[PD] Negative input numbers for [pow] return 0

2013-04-22 Thread Joe White
Hi, Just realised putting a negative number into the [pow] object outputs '0'?!? For example if I do: [-1 ( | [pow 2] it returns 0, where I would expect it to return 1. Is this a known limitation or bug? Are there any work arounds if I want a variable power? (I'm running Pd 0.44.1 on OS X

Re: [PD] Negative input numbers for [pow] return 0

2013-04-22 Thread IOhannes m zmoelnig
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 2013-04-22 14:19, Joe White wrote: Hi, Just realised putting a negative number into the [pow] object outputs '0'?!? For example if I do: [-1 ( | [pow 2] it returns 0, where I would expect it to return 1. Is this a known limitation

Re: [PD] Negative input numbers for [pow] return 0

2013-04-22 Thread Joe White
Is this a known limitation or bug? it's most likely a feature that tries to protect you from things like: [-1( | [pow 0.5] | Ahh yeah makes sense. I'm not sure why but I always feel uneasy using [expr], maybe because of libpd :) [expr] does handle (-1)^0.5 with a NaN output though.

Re: [PD] Negative input numbers for [pow] return 0

2013-04-22 Thread Andy Farnell
If you think about it negative exponents require a completely different algorithm that is discontinuous with the one for positives. Instead of multiplying you divide n times. You can take advantage of b^-n = 1/b^n Use a [moses] and two [pow], where the negative branch then has its

Re: [PD] Negative input numbers for [pow] return 0

2013-04-22 Thread IOhannes zmölnig
On 04/22/2013 04:07 PM, Joe White wrote: Would it be possible to add this to [pow] as well? Something like for negative base values, non-integer exponent values would return NaN? bien sur, it would be easy to add this. the thing is, do we really want that? having NaN's somewhere in your