2018-05-08 18:05 GMT-03:00 Martin Peach chakekatzil@gmail.com:
On Tue, May 8, 2018 at 2:07 PM, Alexandre Torres Porres porres@gmail.com wrote:
... I personally cannot think of any use case where someone relies on pow(-1, 2) generating "0", it just seems wrong to me (i.e. a bug) and allowing it to do that wouldn't break things.
Maybe add another outlet for the imaginary part?
but simply pow(-1, 2) does not generate an imaginary part, right?
well, maybe expanding this to give you complex numbers is stretching a bit. This only uses the pow function from math.c, but that doesn't give you a complex number as the result of something like pow(-2, 3.3), it gives you just 'nan' instead, like what you get from [expr pow(-2, 3.3)]. Making this an object that outputs a complex number requires more surgery and expansion, and I don't really know if we need this in the built in object of [pow], maybe an external?
The question is more of what to do about the inf/nan that comes out, seems the original and general concern in Pd is to turn them into "0", so I did it.
And my deep frustration and motivation is simply that I can't do something like pow(-1, 2) instead of wanting a comex number output... and for that I'm forced to use [expr] instead, but I just don't see the point.