[PD] pow/pow~ and negative input, a fix proposal
Alexandre Torres Porres
porres at gmail.com
Tue May 8 20:07:33 CEST 2018
Hi, I'm basically reviving a discussion I found on the list archive from 5
years ago, see:
Not much came out of it besides the assumption this could be a concern to
prevent inf/nan results!
I can see that, because we have other examples like that in Pd, like
log/log~ outputing -1000 for <= 0 inputs.
But still, that's not a good reason to prevent something like:
So I did a Pull Request where I still make it output "0" when pow/pow~
would give 'inf' or 'nan' but still allow us to calculate the power of
negative numbers. Here it is:
https://github.com/pure-data/pure-data/pull/356 (In another commit, 'm also
proposing log to behave like log~ anyway)
I come to the list to query if anyone thinks there might be a concern in
expanding the behaviour of pow/pow~
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.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Pd-list